yuxiang2013@gmail.com
配置:
.ssh/config
host cms
HostName 114.215.*.*
User zhongxinxin
IdentityFile ~/.ssh/id_rsa
登录:
ssh cms
结果:
zhongxinxin@114.215.*.*'s password:
检查原因:
1.客户端检查
ssh -vv cms,未发现异常
2.服务端检查
执行登录的同时,监控安全日志
sudo tail -f less /var/log/secure
Authentication refused: bad ownership or modes for directory /home/zhongxinxin
解决问题:
google关键字,找到此文章,原因是当前用户的根目录权限设置不妥。
检查发现当前用户根目录的权限是drwxrwx---,通过权限调整,仅保留当前用户权限,问题解决。
chmod g-wrx /home/zhongxinxin
yuxiang2013@gmail.com