使用SSH公钥远程登录服务器,出现Server refused our key;同时,输入正确的用户名及密码出现Access Denied
本地登录服务器,查看auth.log;使用命令:tail -f /var/log/auth.log,出现:
Authentication refused: bad ownership or modes for directory /root
如果出现这个问题,需要查看一下root目录的权限以及目录的属主和属组是否为root;
正常为:
如果日志输出的是:
Authentication refused: bad ownership or modes for directory /root/.ssh
这时候同样的查看/root/.ssh的权限及属主和属组,正常为:
ssh目录下: