Page 1 of 1

SSH connection closed - resolved

Posted: Sun Mar 12, 2017 2:29 pm
by vladlondon
I just bought a new Raspberry Pi 3 and was not able to connect via SSH, even after creating an empty /boot/ssh file. SSH client under linux showed the following:

$ ssh -v 192.168.0.32
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.0.32 [192.168.0.32] port 22.
debug1: Connection established.
debug1: identity file /home/vlad/.ssh/id_rsa type -1
debug1: identity file /home/vlad/.ssh/id_rsa-cert type -1
debug1: identity file /home/vlad/.ssh/id_dsa type -1
debug1: identity file /home/vlad/.ssh/id_dsa-cert type -1
debug1: identity file /home/vlad/.ssh/id_ecdsa type -1
debug1: identity file /home/vlad/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/vlad/.ssh/id_ed25519 type -1
debug1: identity file /home/vlad/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Raspbian-5+deb8u3
debug1: match: OpenSSH_6.7p1 Raspbian-5+deb8u3 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 192.168.0.32

===

SecureCRT at the same time complained about protocol version mismatch if SSH v1 was selected, and just indicated closed connection for SSH v2.

===


Apparently, the SSH keys (/etc/ssh/ssh*key) on the Raspberry were all of zero size for some reason. To fix that I had to run the following commands from the terminal:

$ sudo rm -r /etc/ssh/ssh*key
$ sudo dpkg-reconfigure openssh-server

After the system regenerated the SSH keys I was able to connect via successfully.

Re: SSH connection closed - resolved

Posted: Thu Jul 12, 2018 10:31 pm
by Flavor
Thank you!