[6860] in testers
sshd complaint under RHEL 4
daemon@ATHENA.MIT.EDU (Greg Hudson)
Thu Mar 24 17:54:21 2005
Date: Thu, 24 Mar 2005 17:54:09 -0500
Message-Id: <200503242254.j2OMs9eD029104@egyptian-gods.mit.edu>
From: Greg Hudson <ghudson@MIT.EDU>
To: testers@MIT.EDU
Under RHEL 4, sshd complains at startup that:
Mar 24 17:30:13 error-messages sshd[31286]: Server listening on :: port 22.
Mar 24 17:30:13 error-messages sshd[31286]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
But it works fine. Single-stepping indicates that sshd is calling
getaddrinfo(NULL, "22", ...) with hints.ai_family set to AF_UNSPEC and
hints.ai_flag set to AI_PASSIVE. This gets back two entries for
0.0.0.0, one for IPv6 and a second one for IPv4. Binding to the first
succeeds; binding to the second fails.
This seems like a bug in Linux or in whoever designed the APIs it's
using. I don't see any changes in the openssh trunk which appear
relevant. If I stick either "ListenAddress 0.0.0.0" or "ListenAddress
::" in /etc/sshd_config, the message goes away and the daemon still
works (over IPv4, at least). Running sshd with the -4 flag is also
supposed to work, according to the few google results I could find
about this.
I'll defer to Garry on what seems like the correct fix. Getting rid
of the spurious error message one way or another seems wise, since my
first reaction on seeing it was (a) that I shouldn't expect opensshd
to work, and (b) that maybe my machine had been hacked and something
hostile was running on port 22.