ssh public key authentication fails

Ilya

I copied my public ssh key to a remote server, but the authentication fails with the following ssh output:

ilya@workstation ~ % ssh -v ilya@remoteserver
OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
debug1: Reading configuration data /home/ilya/.ssh/config
debug1: /home/ilya/.ssh/config line 7: Applying options for remoteserver
debug1: /home/ilya/.ssh/config line 43: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Hostname has changed; re-reading configuration
debug1: Reading configuration data /home/ilya/.ssh/config
debug1: /home/ilya/.ssh/config line 43: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Connecting to remoteserver.tu-darmstadt.de [130.83.70.XXX] port 22.
debug1: Connection established.
debug1: identity file /home/ilya/.ssh/id_rsa type 1
debug1: identity file /home/ilya/.ssh/id_rsa-cert type -1
debug1: identity file /home/ilya/.ssh/id_dsa type -1
debug1: identity file /home/ilya/.ssh/id_dsa-cert type -1
debug1: identity file /home/ilya/.ssh/id_ecdsa type -1
debug1: identity file /home/ilya/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/ilya/.ssh/id_ed25519 type -1
debug1: identity file /home/ilya/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 77:35:a6:ca:15:66:5d:05:33:ab:35:35:c6:65:ed:79 [MD5]
debug1: Host 'remoteserver.tu-darmstadt.de' is known and matches the ECDSA host key.
debug1: Found key in /home/ilya/.ssh/known_hosts:60
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/ilya/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/ilya/.ssh/id_dsa
debug1: Trying private key: /home/ilya/.ssh/id_ecdsa
debug1: Trying private key: /home/ilya/.ssh/id_ed25519
debug1: Next authentication method: password

The permission seem to fit: the ~/.ssh folder on the local workstation was set to 700 and ~/.ssh/authorized_keys on the remote server was set to 600.

Do you have any idea, what the problem cold be?

@Jakuje

$ ls -lZd ~ilya ~ilya/.ssh/ ~ilya/.ssh/authorized_keys
drwxr-x--- ilya ilya ?                                /home/ilya
drwxrwxr-x ilya ilya ?                                /home/ilya/.ssh/
-rw------- ilya ilya ?                                /home/ilya/.ssh/authorized_keys
Jakuje

The ~/.ssh folder can not be writable by anyone else than the owner. Remove the group permissions entirely (the below command on the server) and you should be good:

chmod g-rwx ~ylia/.ssh

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SSH Public Key Authentication

From Dev

scripted ssh should not ask for a password if public key authentication fails

From Dev

ssh public key authentication not working

From Dev

ssh public key authentication not working

From Dev

SSH failed public key authentication

From Dev

SSH public key login fails

From Dev

ssh no longer allows public key authentication

From Dev

Server with ssh public key authentication with libssh

From Dev

ssh no longer allows public key authentication

From Dev

SSH authentication by public key and password in the same time

From Dev

How to Debug Public Key SSH Authentication Failure

From Dev

Cannot SSH to Windows with public key authentication

From Dev

SSH Key-based authentication fails

From Dev

Server Authentication via SSH Key fails

From Dev

2 Factor Authentication in SSH using public key and PAM

From Dev

2 Factor Authentication in SSH using public key and PAM

From Dev

SSH public key authentication works on LAN and not from WAN

From Dev

Public key SSH authentication broke on all my ubuntu servers

From Dev

SSH Error: No supported authentication methods available (server sent public key)

From Dev

Still getting a password prompt with ssh with public key authentication?

From Dev

SSH Public Key authentication - works only after a physical login

From Dev

SSH-RSA public key authentication explanation needed

From Dev

Git push fails with public key when using SSH and specifying credentials

From Dev

SSH Public RSA key fails to authenticated after restore

From Dev

SSH Public Key - No supported authentication methods available (server sent public key)

From Dev

SSH - Key based authentication fails after password prompt

From Dev

Public Key authentication failed

From Dev

Public Key authentication failed

From Dev

Invalid public ssh key

Related Related

  1. 1

    SSH Public Key Authentication

  2. 2

    scripted ssh should not ask for a password if public key authentication fails

  3. 3

    ssh public key authentication not working

  4. 4

    ssh public key authentication not working

  5. 5

    SSH failed public key authentication

  6. 6

    SSH public key login fails

  7. 7

    ssh no longer allows public key authentication

  8. 8

    Server with ssh public key authentication with libssh

  9. 9

    ssh no longer allows public key authentication

  10. 10

    SSH authentication by public key and password in the same time

  11. 11

    How to Debug Public Key SSH Authentication Failure

  12. 12

    Cannot SSH to Windows with public key authentication

  13. 13

    SSH Key-based authentication fails

  14. 14

    Server Authentication via SSH Key fails

  15. 15

    2 Factor Authentication in SSH using public key and PAM

  16. 16

    2 Factor Authentication in SSH using public key and PAM

  17. 17

    SSH public key authentication works on LAN and not from WAN

  18. 18

    Public key SSH authentication broke on all my ubuntu servers

  19. 19

    SSH Error: No supported authentication methods available (server sent public key)

  20. 20

    Still getting a password prompt with ssh with public key authentication?

  21. 21

    SSH Public Key authentication - works only after a physical login

  22. 22

    SSH-RSA public key authentication explanation needed

  23. 23

    Git push fails with public key when using SSH and specifying credentials

  24. 24

    SSH Public RSA key fails to authenticated after restore

  25. 25

    SSH Public Key - No supported authentication methods available (server sent public key)

  26. 26

    SSH - Key based authentication fails after password prompt

  27. 27

    Public Key authentication failed

  28. 28

    Public Key authentication failed

  29. 29

    Invalid public ssh key

HotTag

Archive