Resolve ssh_exchange_identification read connection reset by peer

Home > Search

When attempting to connection from machine1 to machine2 using ssh, if ssh_exchange_identification: read: Connection reset by peer appears on machine1 (the client), check the /var/log/secure file on machine2 (the OpenSSH server). In this example, the log on machine2 to indicates that the connection from machine1 was refused.

[root@machine2 ~]# tail /var/log/secure
. . .
Jan 28 10:57:06  machine2  sshd[11467] refused connect from machine1


On machine2 (the server), ensure machine1 (the client) is allowed in the /etc/hosts.allow file.

On machine2 (the server), ensure machine1 (the client) is allowed in iptables.


If the /var/log/secure file on the server displays the IPv6 address instead of the IPv4 address of machine1, you can try to disable IPv4 on machine1 (the client) to see if the issue is due to IPv6.

[root@machine2 ~]# sysctl -w net.ipv6.conf.default.disable_ipv6=1
[root@machine2 ~]# sysctl -w net.ipv6.conf.all.disable_ipv6=1


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter in the box below so that we can be sure you are a human.