SSH is failing due to unknown reason

Hi,

I have setup keys between user1@server1 and user2@server2 however, the ssh is failing.

server1 is Linux 3.10.0-514.6.2.el7.x86_64 #1 SMP whereas server2 is 5.10 Generic_150400-40 sun4v sparc sun4v

I have checked port 22 to be open and keys to be correct. I also find the permissions to be correct.

[user2@server2 .ssh]$ pwd
/web/user2/.ssh

[user2@server2 .ssh]$ ls -la
total 49
drwx------   2 user2 user2       8 Jul 11  2016 .
drwxrwxrwx   4 user2 user2      12 Apr 18 08:00 ..
-rw-------   1 user2 user2    1389 Jul 11  2016 authorized_keys
-rw-------   1 user2 user2     668 Apr 11  2013 id_dsa
-rw-------   1 user2 user2     606 Apr 11  2013 id_dsa.pub
-rw-------   1 user2 user2    5726 Apr 18 07:02 known_hosts
-rw-------   1 user2 user2    2168 Aug 24  2012 known_hosts_bkp

[user1@server1 .ssh]$ pwd
/home/user1/.ssh

[user1@server1 .ssh]$ ls -la
total 180
drwx------  2 user1 user1  4096 Apr 18 08:10 .
drwxr-xr-x 15 user1 user1  4096 Mar  3 10:25 ..
-rw-------  1 user1 user1  2435 Mar 21 16:34 authorized_keys
-rw-------  1 user1 user1  1166 Nov  9 15:17 authorized_keys-bkp
-rw-------  1 user1 user1     0 Nov 10 04:45 config
-rw-------  1 user1 user1   749 Jun 14  2016 dummy
-rw-------  1 user1 user1  3243 Jun 13  2016 id_rsa
-rw-------  1 user1 user1   746 Jun 13  2016 id_rsa.pub
-rw-------  1 user1 user1 83067 Apr 18 08:10 known_hosts
-rw-------  1 user1 user1 51007 Aug 22  2016 known_hosts.2016-08-22

Passwordless login using SSH is not working for some reason.

Here is the debug. Can you please have a look and suggest ?

[user1@server1 roles]$ ssh -vvv user2@server2.com
OpenSSH_6.7p1 (CentrifyDC build 5.2.3-425) , OpenSSL 0.9.8zf-fips 19 Mar 2015
debug1: Reading configuration data /home/user1/.ssh/config
debug1: Reading configuration data /etc/centrifydc/ssh/ssh_config
debug1: /etc/centrifydc/ssh/ssh_config line 49: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to server2.com [10.61.5.21] port 22.
debug1: Connection established.
debug1: identity file /home/user1/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user1/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user1/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user1/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user1/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user1/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user1/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user1/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.1
debug1: match: OpenSSH_7.1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Miscellaneous failure
Matching credential not found

debug1: Miscellaneous failure
Matching credential not found

debug3: load_hostkeys: loading entries for host "server2.com" from file "/home/user1/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/user1/.ssh/known_hosts:29
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-ed25519,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,chacha20-poly1305@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,chacha20-poly1305@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: setup umac-64-etm@openssh.com
debug1: kex: server->client aes128-ctr umac-64-etm@openssh.com none
debug2: mac_setup: setup umac-64-etm@openssh.com
debug1: kex: client->server aes128-ctr umac-64-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA db:a3:f2:7e:2b:5e:58:71:8c:f8:4e:88:bc:8d:8f:6a
debug3: load_hostkeys: loading entries for host "server2.com" from file "/home/user1/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/user1/.ssh/known_hosts:29
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "10.61.5.21" from file "/home/user1/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/user1/.ssh/known_hosts:28
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'server2.com' is known and matches the ECDSA host key.
debug1: Found key in /home/user1/.ssh/known_hosts:29
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/user1/.ssh/id_rsa (0x1fe1980),
debug2: key: /home/user1/.ssh/id_dsa ((nil)),
debug2: key: /home/user1/.ssh/id_ecdsa ((nil)),
debug2: key: /home/user1/.ssh/id_ed25519 ((nil)),
debug3: input_userauth_banner

This system is for the use by authorized users only. All data contained
on all systems is owned by the company and may be monitored, intercepted,
recorded, read, copied, or captured in any manner and disclosed in any
manner, by authorized company personnel. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy. Unauthorized or improper
use of this system may result in administrative, disciplinary action, civil
and criminal penalties. Use of this system by any user, authorized or
unauthorized, constitutes express consent to this monitoring, interception,
recording, reading, copying, or capturing and disclosure.

IF YOU DO NOT CONSENT, LOG OFF NOW.

##################################################################
# *** This Server is using Centrify                          *** #
# *** Remember to use your Active Directory account          *** #
# ***    password when logging in                            *** #
##################################################################

debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/user1/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/user1/.ssh/id_dsa
debug3: no such identity: /home/user1/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/user1/.ssh/id_ecdsa
debug3: no such identity: /home/user1/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/user1/.ssh/id_ed25519
debug3: no such identity: /home/user1/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:

What are the permissions on the home directory, the .ssh directory, and the authorized_keys file? (hint: the directories should be 700 and the file should be 600).

1 Like

Do you have a debug log from the ssh-server too?

The directory permission 700 could be the cause of issue.

Kindly wait before i do some tests and confirm.

---------- Post updated at 09:26 AM ---------- Previous update was at 09:00 AM ----------

Resolved ... Thank you !!

1 Like