How to Fix “ssh_exchange_identification: read: Connection reset by peer”

Recently while tinkering with cloud server firewall settings, I accidentally misconfigured the rules and got locked out of SSH. The error code was as follows:

ssh_exchange_identification: read: Connection reset by peer

Adding the -v parameter shows detailed connection info:

ssh -v  192.168.0.101

Solution: Connect to the Host via VNC or Similar

vi /etc/hosts.allow

Add the following line:

sshd: ALL    ##Allow all IP hosts to connect to this machine

Restart SSH:

service sshd restart

Leave a Comment

Your email address will not be published.