ssh_exchange_identification: Connection closed by remote host

From: Roman Kanala (Roman.Kanala@unige.ch)
Date: 08/16/02


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

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 0.0.0.0 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, roman.kanala@unige.ch



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... ...
    (perl.beginners)
  • 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. ...
    (comp.os.linux.security)
  • 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 ...
    (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.yourDomain.com alchemy ...
    (SuSE)
  • Re[2]: sshd port number ?
    ... >> version of ssh and do some nasty stuff. ... >> privileges can bind to a privileged port. ... D> configure what proc is assigned to what privileged port? ... If the superuser does want to bind to the ...
    (freebsd-questions)