SSH - Resolve ssh_exchange_identification read connection reset by peer

When attempting to connect to an SSH server, if ssh_exchange_identification: read: Connection reset by peer appears, and you have access to the SSH server, and the SSH server is a Linux system, check the /var/log/secure file on the SSH server. In this example, the log on the SSH server indicates that the connection was refused.

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


On the SSH server, ensure connections are allowed in the /etc/hosts.allow file and not denied in the /etc/hosts.deny file.

On the SSH server, ensure connections are allowed in iptables or firewalld.

If the /var/log/secure file on the SSH server displays the IPv6 address instead of the IPv4 address of the client, you can try to disable IPv6 on 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 73ca5 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |