Disclaimer: This article is a blogger original article, welcome to reprint, please indicate the source https://blog.csdn.net/mouday/article/details/90754938
1, the normal configuration ssh does not lead to the entry into force
# 配置ssh
ssh-copy-id root@mastar
# 配置完了还让我输入密码,不能忍!
$ ssh root@mastar
root@mastar's password:
2, view system security logs
$ tail -f /var/log/secure
# 发现一个问题,目录的属主和权限配置不当
Authentication refused: bad ownership or modes for directory /root
SSH does not want the home directory and ~ / .ssh directory has write access to the group
3, modify the permissions
chmod 700 /root
chmod 700 /root/.ssh
chmod 644 /root/.ssh/authorized_keys
4, successful login
$ ssh root@mastar
Reference
to solve not take effect after the successful SSH login configuration problem-free secret