Monday, 4 June 2012

Passwordless SSH login fails

If you are attempting to log in to an openssh server using public key authorisation and it keeps asking for your password anyway then check the permissions on the ssh directory for the user account you are trying to log in as;

ls -al ~/.ssh
drwx------ 2 brett brett 4096 Jun  4 13:40 .
drwx------ 6 brett brett 4096 Jun  4 13:37 ..
-rwx------ 1 brett brett  398 Jun  4 13:40 authorized_keys

If the permissions are anything other than those shown above then you need to fix that;

chmod 700 ~/.ssh
chmod 700 ~/.ssh/*

No comments: