ssh 免密钥失败原因

1.权限问题
本地端
ssh chmod 777 ~/.ssh
sudo chmod 777 /home/当前用户
远程端
.ssh目录下的authorized_keys
sudo chmod 777 ~/.ssh/authorized_keys
2.StrictModes问题
sudo vi /etc/ssh/sshd_config
找到

#StrictModes yes

改成
StrictModes no

按照以上方法设置成功发送公钥,远程端~/.ssh/authorized_keys下有公钥,很完美,but!!!
ssh 用户名@远程ip 还是提示密码?? what the fuck!!!

#RSAAuthentication yes  
#PubkeyAuthentication yes  
#AuthorizedKeysFile .ssh/authorized_keys  

把这三行注释取消

$ service sshd restart  #重启远程机ssh服务

终于免密登陆成功

原文地址:https://www.cnblogs.com/Jason-lin/p/7854120.html