4

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 [email protected]
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.
phemmer
  • 70,657
  • 19
  • 188
  • 223
user58125
  • 41
  • 1
  • 2
  • 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? – phemmer Jan 30 '14 at 13:26
  • Check server logs as well, please. – peterph Jan 30 '14 at 14:29

2 Answers2

2

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.

lh0n42
  • 21
  • 3
0

Did you set the following options in your sshd config?

PermitRootLogin
AuthorizedKeysFile
peterph
  • 30,520
  • 2
  • 69
  • 75
mwolf
  • 21
  • 2