patch for problem with "Bind to port 22 on 0.0.0.0 failed: Address already in use."

Pekka Savola pekkas at netcore.fi
Tue Nov 27 23:37:57 EST 2001


On Tue, 27 Nov 2001, Jan Cihlar wrote:
>   there is a cosmetic problem in openssh (all versions AFAIK):
> 
> When you start sshd with no "ListenAddress" lines in sshd_config, it
> tries to bind address "::" (successfuly) and then "0.0.0.0" and it fails
> with "Address already in use". Moreover it can happen that "0.0.0.0" is in 
> addr list sooner than "::" so sshd than will listen only on ipv4 address 
> "0.0.0.0".

This is a Linuxism; binding with standard kernel to both '::' and 
'0.0.0.0' will fail.  This is because '::' already accepts IPv4 
connections though mapped addresses.  Double-binding is not possible as 
with IPv6.

Just work around this by listening to :: only, if you have to.  It's best 
to leave ListenAddress empty.

-- 
Pekka Savola                 "Tell me of difficulties surmounted,
Netcore Oy                   not those you stumble over and fall"
Systems. Networks. Security.  -- Robert Jordan: A Crown of Swords




More information about the openssh-unix-dev mailing list