For convenience, I use public/private key ssh authentication to login remote servers. All servers work out fine but just this one particular server did not work out. It has been bothering me for a while and finally I got fed up today and decided to solve it once for all. If you have the same problem, please check below for description and steps to solution!
The content of
/var/log/secure from remote server actually points out cause of the problem already.
We can see clearly that the permission of the directories is wrongly set, so all we have to do is set it correctly!
The main point to get all these things work is NOT to have
write permission set to the
According to CentOS wiki, 700 is the preferred permission to the directory but after testing, it will be fine as long as write permission is not set to group.
Assume permission of my directories are set as below
Use commands below to set direcotory’s permission correctly.
chmod 700 ~/.ssh chmod 700 ~/
This solved my problem, does it solve yours?