The solution to still need to enter the password after centos configures ssh password-free login

After creating a new user aps, perform password-free login. When performing ssh login, password-free login is still required. Later, I will find a solution to the problem on the Internet.

First we need to check the system log file

?
1
tail /var/log/secure -n 20

Found the problem: Authentication refused: bad ownership or modes for file

Literally, it can be seen that the owner and permissions of the directory are improperly configured. Looking for information, we know that: SSH does not want the home directory and the ~/.ssh directory to have write permissions for the group. Change it through the following commands


[aps@aps01 ~]$ chmod g-w /home/aps
[aps@aps01 ~]$ chmod 700 /home/aps/.ssh
[aps@aps01 ~]$ chmod 600 /home/aps/.ssh/authorized_keys

Links for specific reasons:

http://www.jb51.net/article/121180.htm


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325641628&siteId=291194637