≡ Menu

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.

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 1 comment… add one }

  • ismael silva January 11, 2012, 9:57 pm

    Set the correct permission from home directory user…
    this will to be. “755”.

Leave a Comment