Re: ssh_exchange_identification: Connection closed by remote host

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

Date: Fri, 16 Aug 2002 16:57:41 +0200
From: Roman Kanala <>

A few minutes ago, I wrote:

> 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,

It was in .ssh or .ssh2 within home directory on the client side. I have
wiped them out and got a usual inital question about re-creating code
keys. Also, it's good to check hosts.allow, the mine was OK. It works

Roman Kanala

Relevant Pages

  • Re: Net::SSH::Perl bind socket problem
    ... >> bind to), maybe the ssh object is not destroyed between the loops. ... > I did use netstat -neat during, and after the script launch. ... only to handle the "port already in use" case... ...
  • Re: unsuccessful hacking attempt at my machine
    ... Because when they send a connection request packet to your IP port 22 ... It would be imposible for them to actually try to login in via ssh without ... keys from them. ... Or just change your ssh port. ...
  • Re: cygwin port forwarding and privileged ports
    ... It is probably because Port 135 is used for RPC in a windows machine .. ... I am added to the Administrators group, and even tried to do this ... Is the bind really failing or ssh ...
  • Re: [opensuse] Coordinated, distributed ssh attacks?
    ... Have you moved ssh to a high port yet? ... collect you public keys in one location on a box that you can reach ... Host alchemy ...
  • Re: cant run sshd on 23456 in Fedora 19
    ... there's no need for SSH to be on a port other than TCP/22 and this prevents ... But it's not a good idea to move SSH to a port over 1024 since it leaves ... you in a potentially vulnerable state in terms of attack surface. ... Only root can bind below 1024 so if SSH (or ...