Fix ssh_exchange_identification: read: connection reset by peer

1424

Users can face the problem of Fix: ssh_exchange_identification: read: connection reset by peer if they try to ssh into any type of Unix server.

Across the whole Unix and Linux, ssh is universal. So with every time the remote server resetting the connection without the user’s permission, this problem may occur.

This problem can also happen with the users having windows with Cygwin as they try to access Ubuntu or macOS.

With the terminal to ssh into Arch, CentOS, or Fedora. But this problem is fixable and here is how you do it.

How to Fix: ssh_exchange_identification: read: connection reset by peer

Users are advised to follow the below listed steps properly to solve the problem of Fix: ssh_exchange_identification: read: connection reset by peer –

Method 1: Check the hosts.deny File

In the cases of users having administrative advantages on the server, they can prompt a log directly into the server of the computer.

There they can have a look at the hosts.deny file. This is the easiest way to solve the problem.

Step 1:  At first type ‘sudo nano/etc/hosts.deny on the server. There the users can check if their machine is listed as banned.

Step 2: Then if the machine is listed under banned, users can remove it. Then it is to be reconnected via ssh on another computer. Now type sudo/etc/hosts.allow.

Users should keep in mind that if they add them manually, it is needed to follow the informational text.

Like they need to add All: yourstechy.com so that everyone on yourstechy.com can connect to the server. At last press Ctrl + O and save the file. Then exit by pressing Ctrl + X.

Users can follow this method of Check the hosts.deny file to solve the problem of Fix: ssh_exchange_identification: read: connection reset by peer i.

Method 2: Changing ssh Configuration Options

Users should do as the bellow listed steps –

Step 1: At first, clear out old ssh configuration files.

Step 2: If this method doesn’t work, add the v option and make an attempt to connect again.

Step 3: If the machine still shows an error message, then add – caes256-ctr to the ssh command.

Step 4: When the trouble is in any types of Cisco branded goods, add – c aes256-ctr to ssh command to solve the problem.

Users can follow this method of changing ssh configuration options file to solve the problem of Fix: ssh_exchange_identification: read: connection reset by peer i.

Method 3: Overriding Accidental IP Bans

The server can take the user as a bad IP address if there’s a continuous try to log in and denial. To ensure that this is not the case –

Step 1: At first run sudo iptables – L – line – number to find the IP adress.

Step 2: After finding the problem, run iptables-D and offending chain, chain number so that software won’t ban the user again.

Step 3: Then edit the file named /etc/fail2ban/jail.conf. Now run sudo nano/etc/fail2ban/jail.conf.

Step 4: Add IP address to this line. It will ban fail2ban to add the users’ IP address to any kind of blocklist.

Conclusion

Users can follow the above-listed methods to solve the problem of Fix: ssh_exchange_identification: read: connection reset by peer.