Wednesday 16 August 2017

How to fix Authentication refused: bad ownership or modes for directory

While setup public key authentication if getting this error in /var/log/secure logs, the problem with permission on directory and files.

Solution: Need to change permissions on directory and file like following example commands on the user account:

[root@linuxcnf ~]# chmod go-w ~/
[root@linuxcnf ~]# chmod 700 ~/.ssh
[root@linuxcnf ~]# chmod 600 ~/.ssh/authorized_keys

That’s it, now try to login with public key and now you should able to access without password.

No comments:

Post a Comment