问题:
密钥登陆时报如下错误:
May 13 10:11:26 keep sshd[25103]: Authentication refused: bad ownership or modes for file /home/git/.ssh/authorized_keys
原因:
sshd 为了安全, 对属主的目录和文件权限有所要求. 如果权限不对, 则 ssh 的免密码登陆不生效.
用户目录权限为 755 或者 700, 就是不能是 77x.
.ssh 目录权限一般为 755 或者 700.
rsa_id.pub 及 authorized_keys 权限一般为 644
rsa_id 权限必须为 600
解决:
修改相应目录和文件的权限即可.
来源: http://www.bubuko.com/infodetail-2599157.html