0

I have created keygen and public key I have copied to the remote host. First day it worked fine without any issue, I could transfer the files from my host to remote host with out prompting me for password. Next day during the batch sftp jobs failed and i tried manually connecting to remote host. It is throwing me this particular error:

[user@uat-try-app dbconfig]$ ssh '[email protected]' Read from socket failed: Connection reset by peer

I am unable to understand where the issue is exactly.

If i do ssh -v on remote host i get below details.

[murex@uat-try-app ssh]$ ssh -vvv '[email protected]' 
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: Applying options for * debug2: ssh_connect: needpriv 0 
debug1: Connecting to 192.168.248.30 [192.168.248.30] port 22. 
debug1: Connection established. 
debug1: identity file /home/murex/.ssh/identity type -1 
debug3: Not a RSA1 key file /home/murex/.ssh/id_rsa. 
debug2: key_type_from_name: unknown key type '-----BEGIN' 
debug3: key_read: missing keytype 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug2: key_type_from_name: unknown key type '-----END' 
debug3: key_read: missing keytype 
debug1: identity file /home/murex/.ssh/id_rsa type 1 
debug1: identity file /home/murex/.ssh/id_dsa type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_5.3 
debug2: fd 3 setting O_NONBLOCK 
debug1: SSH2_MSG_KEXINIT sent 
debug3: Wrote 792 bytes for a total of 813

Kindly please help me in resolving this.

Regards, Ram

3
  • Isn't it obvious? debug3: Not a RSA1 key file /home/murex/.ssh/id_rsa.. Whatever you have there is not a cryptographic key. Dec 1, 2015 at 6:46
  • Hi Marius, You want me to create new public private key ?
    – Ram
    Dec 1, 2015 at 7:04
  • Have a look on the server logs. It should give you some clue about the problem.
    – Jakuje
    Dec 1, 2015 at 7:53

2 Answers 2

1

Your local id_rsa private key seems to be not valid. You could look at it using:

cat ~/.ssh/id_rsa

And see if it looks ok. Did you generate this file, or was it copied from some other machine?

Worst case you should generate a new private/public key pair and redo the copy with

ssh-copy-id [user@]machine
3
  • I have generated new key pair and when am trying to copy the file, it says, [user@uat-try-app .ssh]$ ssh-copy-id [email protected] Read from socket failed: Connection reset by peer
    – Ram
    Dec 1, 2015 at 8:53
  • Good way to check the certificate is: ssh-keygen -y Dec 1, 2015 at 14:52
  • id_rsa is not invalid. This is misleading noise in max debug -vvv due to the history of OpenSSH; it tries to parse key files first as rsa1 format for SSHv1 and only if that fails it tries PEM formats for SSHv2 (OpenSSL or for recent versions OpenSSH). SSHv1 is weak and obsolete and almost never used and thus keyfiles are rarely rsa1, but the code is still there. After the spurious errors it says 'Identity file /path/id_rsa type 1' -- a type greater than zero means success. Dec 2, 2015 at 9:55
0

Thanks Olaf & Marius, The issue was with ssh service running on the server. SO we have restarted the ssh service and issue the issue got resolved. Becauase of ssh service issue even it was not prompting for password when I was trying to transfer the public key.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .