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

Subscribe
Notify of
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
anonymous
14 years ago

hello,

I do have the same problem, but when I tried these steps, it didn’t worked for me. Am I somewhere wrong ?

thanks & regards
nicole.


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

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

 

2
0
Would love your thoughts, please comment.x
()
x
The IT Development and Technology Mini Vault | MicroDevSys.com
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.