Thursday, May 17, 2012

SSH Authentication refused: bad ownership or modes for file /home/user/.ssh/authorized_keys2

I'm trying to login using ssh keys but server is only allows to login me using a password. The following message is logged into server /var/log/secure file:
Feb 25 06:36:50 ns5 sshd[26681]: Authentication refused: bad ownership or modes for file /home/user/.ssh/authorized_keys2
How do I fix this problem?

You need to set correct permission on server. Login to your account using passwod. Once logged in type the following command to fix this issue:
chmod 0644 ~/.ssh/authorized_keys2
Now, you should able to login using ssh keys from your workstation or other servers.

No comments:

Post a Comment