ssh_exchange_identification: Connection closed by remote host

From: Roman Kanala (
Date: 08/16/02

Date: Fri, 16 Aug 2002 14:21:22 +0200
From: Roman Kanala <>

I needed to swap two machines so I have first prepared the system,
synchronised user data, changed their IPs and restarted. Everything
works except SSH.

I am using OpenSSH 3.4p1 with tcp-wrapper compiled in. There were
several steps that had to be done and I saw in the archives that many
people looked for help on this, so here are the details:

Bind to port 22 on failed: Address already in use.
Cannot bind any address.

This was the inetd already listening on port 22. sshd wanted to create
keys and did not start properly from rc.tcpip, then it could not start
anymore because port 22 was already bound to tcp_wrapper. It
does not appear in ps, top, netstat so it's hard to find.

Now, I have a different problem:

ssh_exchange_identification: Connection closed by remote host

I have probably re-create keys. I did it for system-level keys but
there probably are more of them. When changing identities, they
prevent negotiating the connection. Did someone already have this
type of problem ?

Roman Kanala,

Relevant Pages