You get this when trying to SSH to a host from some IP (Let's assume it's 18.104.22.168 for the scope of this problem):
ssh_exchange_identification: Connection closed by remote host
What to do?
It had to do with security and /etc/hosts.allow in my case. The steps are:
- vi /etc/hosts.allow (Or if you prefer nano /etc/hosts.allow OR pico /etc/hosts.allow)
- Add lines at the end such as:
# My Remote Host
- Above are examples of IP octets. We are using 111.22 if the remote IP is 22.214.171.124 and CIDR is 126.96.36.199/16)
- Save the file and exit (In VI use :wq! )
- Try again from the IP of the remote host (In the above case, 188.8.131.52 )
Or at least that was the source of the issue for me. Hope it helps!