Page cover

Connection reset by peer

SSH Problem

How can I fix "kex_exchange_identification: read: Connection reset by peer"?

The error is:

kex_exchange_identification: read: Connection reset by peer
Connection reset by x.x.x.x port 22
Connection closed by x.x.x.x port 34976

It could be the process on the server side listening to the SSH port is dead, and even a restart / stop service do not work. So to find the process, and killing it may solve the problem.

Let's debug more with netstat:

sudo netstat -ntlp

Time to kill pid:

sudo kill 619
sudo netstat -ntlp

Now, the issue is fixed:

sudo systemctl restart ssh
sudo systemctl status ssh

Last updated