Ubuntu – Ssh not accepting public key

10.04sshsshd

I recently installed ubuntu 10.04 and trying to connect to remote servers with SSH, which is failing to connect with public key.

I created the DSA keys, then did a ssh-copy-id to the remote server which created the .ssh/authorized_keys file, and permissions of 600.

I have an SSH agent running on Ubuntu which accepts the password, but some of the remote systems (F5 Big IP load balancers) still prompt me for password.

I have verified the sshd_config file on the remote systems to validate nothing is different on from one system to another.

The Debug output on the one that works is as follows:

debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/me/.ssh/id_dsa 
debug1: Server accepts key: pkalg ssh-dss blen 433 
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session] 
debug1: Entering interactive session. 
debug1: Sending environment. 
debug1: Sending env LANG = en_US.UTF-8 

The debug output of the failed system is as follows:

debug1: Authentications that can continue: publickey,keyboard-interactive 
debug1: Next authentication method: publickey 
debug1: Offering public key: /home/me/.ssh/id_dsa 
debug1: Authentications that can continue: publickey,keyboard-interactive 
debug1: Trying private key: /home/me/.ssh/id_rsa 
debug1: Next authentication method: keyboard-interactive 
Password:

The authorized_keys file are identical on each system, with the same permissions, and the sshd_config file are identical, as well as versions of SSH.

Best Answer

The info you posted looks fine. Out of curiosity, why are you using dsa keys instead of rsa? Check the permissions and ownership on all files and directories (ie: ./.ssh/) Is the user account locked? (can you login with the password?) Failing that, check the server log file, which should tell you why it is refusing the public key (you may want to start the server in more verbose mode if it isn't immediately clear why) - comparing the one that works with the one that does not for clues.