Header Shadow Image


Linux: The source of ssh_exchange_identification: Connection closed by remote host

PROBLEM

You get this when trying to SSH to a host from some IP (Let's assume it's 111.22.33.44 for the scope of this problem):

ssh_exchange_identification: Connection closed by remote host

What to do?

SOLUTION

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
sshd: 111.22.  

  • Above are examples of IP octets.  We are using 111.22 if the remote IP is 111.22.33.44 and CIDR is 111.22.0.0/16)
  • Save the file and exit (In VI use :wq! )
  • Try again from the IP of the remote host (In the above case, 111.22.33.44 )

Or at least that was the source of the issue for me.  Hope it helps!

Good Luck!
TK


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License