≡ 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.

Sysadmin because even developers need heroes!!!

Share this tutorial on:
{ 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”.

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , , , , , , , , , , , ,