SSH – Fixing ssh_exchange_identification: Connection Closed by Remote Host

ssh

I failed in ssh connection to a server. Here is the output of connection

$ ssh -v [server]
OpenSSH_5.1p1 Debian-3ubuntu1, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /home/tim/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [server] [server ip] port 22.
debug1: Connection established.
debug1: identity file /home/tim/.ssh/identity type -1
debug1: identity file /home/tim/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/tim/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host`

Anyone know what's wrong? Thanks and regards!

Best Answer

Check to see if the IP you are connecting from is showing up in /etc/hosts.deny on the remote server, and also check to see if you have lots of failed login attempts in /var/log/secure. If you do, delete those entries out of both files and you can sometime get back in.