SSH is failing due to unknown reason


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SSH is failing due to unknown reason
# 1  
Old 04-18-2017
Hammer & Screwdriver 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.

Code:
[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 ?

Code:
[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:


Last edited by mohtashims; 04-18-2017 at 10:11 AM..
# 2  
Old 04-18-2017
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).
This User Gave Thanks to Padow1 For This Post:
# 3  
Old 04-18-2017
Do you have a debug log from the ssh-server too?
# 4  
Old 04-18-2017
Quote:
Originally Posted by Padow1
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).
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 ----------

Quote:
Originally Posted by Padow1
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).

Resolved ... Thank you !!
This User Gave Thanks to mohtashims For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ssh fails due to argument position.

I have a constraint to follow organization policy. So i do not have much liberty. ssh -i /opt/nonprod user1@hostone -t bash works while ssh -i /opt/nonprod -t bash user1@hostone fails How can I get this to work when I am enforced to put -t bash before the user@hostname ? Will share debug... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. Shell Programming and Scripting

Ssh failing due to Bad owner error

i am logged in with "user1" on host1. I m trying to ssh to host2 using user id "user2" $ ssh user2@host2 Bad owner or permissions on /home/user1/.ssh/config Question 1: Can you please tell me why am i getting the Bad owner permissions error on that directory ? Question 2: Where is it... (7 Replies)
Discussion started by: mohtashims
7 Replies

3. UNIX for Advanced & Expert Users

Unix script seems to be momentarily creating child process for unknown reason

Hi, I have a unix script that basically has a while loop inside which it checks Oracle database for certain records. If it finds the records, it does some processing and then goes back to the while loop. If it doesnot find any matching records, then it sleeps for 30 seconds and then goes back to... (17 Replies)
Discussion started by: waavman
17 Replies

4. Solaris

zip -r <directory> failing due to 2GB limit - Just asking opinion

Hi, Am trying to run zip -r on a 2.4G directory and it is failing with the error below. I believe this is because of the 2G limit of the zip program. server101(oper01)/u01/temp$: date Thu Mar 15 12:53:44 NZDT 2012 server101(oper01)/u01/temp$: ls -l total 8 drwxr-x--x 4 oracle dba ... (1 Reply)
Discussion started by: newbie_01
1 Replies

5. Shell Programming and Scripting

UNIX script abruptly ending due to ssh command

Below UNIX script abruptly ends while reading second line from file. When I comment 'ssh' command the script works as expected. I think I will have to run ssh command in a different process, but haven't got a handle yet as regards to how to do that. Any help in resolving this problem is highly... (1 Reply)
Discussion started by: jeeteshkc
1 Replies

6. Shell Programming and Scripting

how do i avoid system hang due to ssh in script?

I have a script that collects data from about 200 servers using 'ssh'. The problem is that, process sometime hangs at some point stopping the execution of the script. Please give me some idea how can I force the execution to jump to the next step if there arises any problem !! Thanks for replies if... (1 Reply)
Discussion started by: mdangol
1 Replies

7. Shell Programming and Scripting

Dropping Records for unknown reason in awk script

Hi, I have written the following it is pretty sloppy but I don't see any reason why I should be losing 54 records from a 3.5 million line file after using it. What I am doing: I have a 3.5 million record file with about 80,000 records need a correction. They are missing the last data from... (8 Replies)
Discussion started by: mkastin
8 Replies

8. Shell Programming and Scripting

Writing to file failing (maybe due to lock?)

Driver script kicks off supporter scripts in background. The supporter script writes it's own PID ($$) into a status file. When script completes, deletes the PID from the status file. The driver script constantly polls this status file for number of lines. As and when it's get lower than XX... (2 Replies)
Discussion started by: baivab
2 Replies

9. Shell Programming and Scripting

IF condition failing in a SSH script

Hi, I'm ssh-in to a remote machine (ubuntu) and trying to execute a little script in there.The script looks like this: ssh user@ubuntu <<EOF cd ~/test ls -l echo "Continue counting files starting with a`s ?" read answer if then ls -l a* else exit fi EOF Now everything works... (9 Replies)
Discussion started by: rubionis
9 Replies

10. Shell Programming and Scripting

ssh - rm failing

Hi, Please help me... I am creating a string of filenames with absolute path and deleting those files situated in the remote server using ssh .. but it doesnot work.. Can anyone help me... here is my code for FileName in ${myDire} do Tmp=`basename... (4 Replies)
Discussion started by: shihabvk
4 Replies
Login or Register to Ask a Question