使用key登录远程服务器时,一直登录不进去,查看secure日志出现下面的日志信息:

May 25 13:57:23 zhao-file sshd[881]: [ID 800047 auth.info] Authentication refused: bad ownership or modes for directory /home/ckl

 

这里主要是权限设置不当造成的:

用户目录权限为 755 或者 700就是不能是77x
.ssh目录权限为755
rsa_id.pub 及authorized_keys权限必须为644
rsa_id 权限必须为600

chmod go-w ~/

chmod 700 ~/.ssh

chmod 600 ~/.ssh/authorized_keys