[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh woes [solved] [Read from socket failed: Connection reset by peer]



On Sat, 2011-11-06 at 21:55 -0700, Bill wrote:
> Hi folks,
> 
> I've Googled myself blind over this one, but all I can find are
> hundreds of people with the same problem and no real solutions.
> I suspect the answer is staring me in the face but I just don't
> see it.
> 
> While I can ssh from my desktop to my laptop, I cannot ssh from
> my laptop to my desktop. However, I can ping the desktop from 
> the laptop no problem. Likewise I can scp files to/from the 
> laptop as long as I am working on the desktop.
> 
> When I try and ssh from the laptop to the desktop I get the 
> error message: 
> Read from socket failed: Connection reset by peer
> 
> Here's some additional output:
> 
> me@laptop:~$ ssh -vvv desktop
> 
> OpenSSH_5.5p1 Debian-6, OpenSSL 0.9.8o 01 Jun 2010
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: Applying options for *
> debug2: ssh_connect: needpriv 0
> debug1: Connecting to desktop [192.168.1.10] port 22.
> debug1: Connection established.
> 
> debug3: Not a RSA1 key file /home/me/.ssh/id_rsa.
> debug2: key_type_from_name: unknown key type '-----BEGIN'
> debug3: key_read: missing keytype
> debug3: key_read: missing whitespace
> debug2: key_type_from_name: unknown key type '-----END'
> debug3: key_read: missing keytype
> debug1: identity file /home/me/.ssh/id_rsa type 1
> debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
> debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
> debug1: identity file /home/me/.ssh/id_rsa-cert type -1
> debug1: identity file /home/me/.ssh/id_dsa type -1
> debug1: identity file /home/me/.ssh/id_dsa-cert type -1
> debug1: Remote protocol version 2.0, remote software version
> OpenSSH_4.3p2 Debian-9
> debug1: match: OpenSSH_4.3p2 Debian-9 pat OpenSSH_4*
> debug1: Enabling compatibility mode for protocol 2.0
> debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-6
> debug2: fd 3 setting O_NONBLOCK
> debug1: SSH2_MSG_KEXINIT sent
> Read from socket failed: Connection reset by peer
> 
> 
> And from the desktop side in /var/log/auth.log
> 
> Jun 11 20:30:26 desktop sshd[2575]: error: Could not load host
> key: /etc/ssh/ssh_host_rsa_key
> Jun 11 20:30:26 desktop sshd[2575]: error: Could not load host
> key: /etc/ssh/ssh_host_dsa_key
> 
> Any suggestions here?
 

Well I was right. I was looking in the wrong place. In writing 
the original email message I provided information about error 
messages on both the desktop and the laptop. On a hunch, I 
compared the /etc/ssh/ directories on both. The laptop had
keys in it whereas the desktop did not for some reason. I'd 
spent most of my time looking on the laptop not the desktop 
and in ~/.ssh not in /etc/ssh. And so:

root@desktop:/etc/ssh# 
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key 

generated the necessary keys and I was able to ssh from the 
laptop. Simple really. Just looking in the wrong place. As
usual. But alls well that ends well.

Hope this helps someone else.

	b.



Reply to: