> 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

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
now.

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: 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 ...(Fedora)