ssh_exchange_identification: read: Connection reset by peer

This is an indication that there is no SSH service detected on the configured port.

By default, SSH uses port 22, though advanced users sometimes change this.

If you are using a Raspberry Pi, the most likely explanation is that you have not yet enabled SSH.  For security reasons, recent versions of the Raspbian Stretch operating system turn off the ssh server "sshd" by default.

You can enable ssh on the Pi at the time you create the SD card by creating a file with the name "ssh" in the boot partition.  If you do this, then sshd starts automatically.

If you did not do this and are using a keyboard and monitor connected directly to the Pi, run the "raspi-config" program and enable ssh as follows:

sudo raspi-config

 

 

 

Now double check that "sshd" shows up as follows when you run:

sudo netstat -lpn | grep tcp

pi@raspberrypi:~ $ sudo netstat -lpn | grep tcp
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 401/sshd
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 449/vncserver-x11-c
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 509/nginx: master p
tcp6 0 0 :::22 :::* LISTEN 401/sshd
tcp6 0 0 ::1:3350 :::* LISTEN 457/xrdp-sesman
tcp6 0 0 :::3389 :::* LISTEN 492/xrdp
tcp6 0 0 :::5900 :::* LISTEN 449/vncserver-x11-c
tcp6 0 0 :::80 :::* LISTEN 509/nginx: master p
pi@raspberrypi:~ $

Note that the connection error message when you attempt to connect directly on the LAN when sshd is not running looks like:

pi@raspberrypi:~ $ ssh -l pi 192.168.1.70
ssh: connect to host 192.168.1.70 port 22: Connection refused

while trying to make an SSH connection through remote.it results in a different error:

pi@raspberrypi:~ $ ssh -l pi proxy21.rt3.io -p 34644
ssh_exchange_identification: read: Connection reset by peer
pi@raspberrypi:~ $

remote.it Service TCP Port setting doesn't match SSH server

If there is a mismatch between the port configured on the SSH server and the port specified when configuring the remote.it Service, you will also get this error.  Make sure that the port used when configuring your remote.it Service matches what is actually in use.

Use the "netstat" command as shown above to list active TCP listeners.

The SSH server is usually called "sshd" but it could be "dropbear" or something else completely.  Check the documentation for your OS to be sure.

Was this article helpful?
0 out of 0 found this helpful