Possible Duplicate:Why am I still getting a password prompt with ssh with public key authentication? I have ssh access to two sever. One old one and one new one. For the old one I use the tutorial SSH login without password to login without typing the password every time. For the new machine I followed the tutorial again, but this time it is not working. I looked at the debug output from ssh (-v option) and it seems to me that the new server does not accept my public key. But I checked and bot authorized_keys are the same, I even used md5sum.What could be the problem and how could I fix this? Debug output for old server where it does work (snippet):debug1: Authentications that can continue: publickey,passworddebug1: Next authentication method: publickeydebug1: Offering RSA public key: /home/NICK/.ssh/id_rsadebug1: Server accepts key: pkalg ssh-rsa blen 277Debug output for new server where it does not work (snippet):debug1: Authentications that can continue: publickey,passworddebug1: Next authentication method: publickeydebug1: Offering RSA public key: /home/NICK/.ssh/id_rsadebug1: Authentications that can continue: publickey,passworddebug1: Trying private key: /home/NICK/.ssh/id_dsa[UPDATE] Ownership of authorized_keys on remoteNICK@server-new:~/.ssh$ ls -ltotal 4-rwx------ 1 NICK NICK 404 2012-08-08 16:11 authorized_keysComplete debug output for the not working server:OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012debug1: Reading configuration data /home/NICK/.ssh/configdebug1: /home/NICK/.ssh/config line 1: Applying options for foo2debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 19: Applying options for *debug1: Connecting to foo-serv2.cs.bar.it [XXX.XXX.XXX.XXX] port 22.debug1: Connection established.debug1: identity file /home/NICK/.ssh/id_rsa type 1debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048debug1: identity file /home/NICK/.ssh/id_rsa-cert type -1debug1: identity file /home/NICK/.ssh/id_dsa type -1debug1: identity file /home/NICK/.ssh/id_dsa-cert type -1debug1: identity file /home/NICK/.ssh/id_ecdsa type -1debug1: identity file /home/NICK/.ssh/id_ecdsa-cert type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-4ubuntu6debug1: match: OpenSSH_5.5p1 Debian-4ubuntu6 pat OpenSSH*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdebug1: SSH2_MSG_KEX_DH_GEX_INIT sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdebug1: Server host key: RSA XXXdebug1: Host 'foo-serv2.cs.bar.it' is known and matches the RSA host key.debug1: Found key in /home/NICK/.ssh/known_hosts:34debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: Roaming not allowed by serverdebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickey,passworddebug1: Next authentication method: publickeydebug1: Offering RSA public key: /home/NICK/.ssh/id_rsadebug1: Authentications that can continue: publickey,passworddebug1: Trying private key: /home/NICK/.ssh/id_dsadebug1: Trying private key: /home/NICK/.ssh/id_ecdsadebug1: Next authentication method: password
Server does not accept public key for ssh login without password
ssh
Did you make sure that the ownership and mode of your ~/.ssh directory on the remote side is correct? It should be owned by you, and have 0700 permissions, i.e. chmod 700 ~/.ssh. Also chmod go-w ~ as this is checked also - because anyone with write permission on your home directory can change the permissions of the .ssh directory.