1. 使用ssh -vvv hostname 登陆测试
返回了
debug3: receive packet: type 51
然后提示使用密码登陆
debug1: Next authentication method: password
2. 修改.ssh目录权限,authorized_keys权限
结果:还是一样
3. 网上还有其他人说的,修改/etc/ssh/sshd_config 也是不行
4. 最后使用了
sshd - SSH-Key authentication fails - Super Userzz
这篇文章提到的方法好了
sudo chmod o-rwx /home/yourusername/ -R