This question already has an answer here:

debug ssh works

Authentications that can continue: publickey

debug1: Next authentication method: publickey
debug1: Offering public key: /home/vinatia/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.

debug ssh doesn't work

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/vinatia/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.

marked as duplicate by Gilles, jasonwryan, Anthon, terdon, strugee Jan 31 '14 at 3:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Are you sure you've transferred your public key to this other server? Are the permissions correct on the .ssh directory of the server? What do the sshd logs on the server say? – Patrick Jan 30 '14 at 13:26
  • Check server logs as well, please. – peterph Jan 30 '14 at 14:29

Here is what I'd check first:

Try running $ grep "ssh" /var/log/syslog on both client and server hosts. Depending on you distro it could also be /var/log/messages. Usually the ssh server/client logs the reason why the authentication was rejected there.

Usually, the culprits are:

On the server:

  1. /etc/sshd_config has a typo on the path to the AuthorizedKeysFile file.

  2. ~/.ssh/authorized_keys has an invalid public key. This can easily happen if you copy&pasted the key and accidentally missed any part of the key.

  3. Permissions for ~/.ssh/authorized_keys are either too loose or too strict.

    chmod 700 .ssh
    chmod 600 .ssh/authorized_keys
    

On the client host, the one you are ssh'ing from:

  1. Check the permissions for your private key on ~/.ssh/private_key_file:
    chmod 700 .ssh
    chmod 600 .ssh/private_key_file

Check these and let us know how it goes.

Did you set the following options in your sshd config?

PermitRootLogin
AuthorizedKeysFile

Not the answer you're looking for? Browse other questions tagged or ask your own question.