CentOS Bug Tracker
CentOS Website

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003234 [CentOS-5] openssh-server minor have not tried 2008-11-10 05:35 2008-11-10 19:51
Reporter michal View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 5.2
Summary 0003234: openssh-4.3p2-26.el5_2.1 has trouble with handling its own sockets
Description I noticed that for the first time when I attempted to add an additional openssh server, to be used to forward some protocols, on port 2345. The following
showed up in /var/log/secure:

 sshd[24329]: Server listening on :: port 2345.
 sshd[24329]: error: Bind to port 2345 on 0.0.0.0 failed: Address already in use

Only later I noticed that logs are contain a lot of

 sshd[2095]: Server listening on :: port 22.
 sshd[2095]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.

Somehow that does not seem to visibly affect a normal operation of an sshd server but attempts to do some port forwarding using a server on 2345 and -R option came to naught.
Additional Information After replacing 4.3p2-26.el5_2.1 with openssh-5.1p1-4 (slightly adjusted
Fedora 9 package redone without selinux support and rebuild on 5.2) I now
see in logs:

 sshd[3286]: Server listening on :: port 2345.
 sshd[3286]: Server listening on 0.0.0.0 port 2345.

and the same for port 22, and all intended port forwarding works as expected.

I did not try if 'AddressFamily inet' in sshd_config would allow me to workaround these issues as I though about this possibility too late.
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0008253)
smooge (developer)
2008-11-10 14:38

The problem you are seeing is due to the fact that the /etc/ssh/sshd_config is trying to listen on IPV6 and IPv4

change the config to

ListenAddress 0.0.0.0
#ListenAddress ::

and that should stop the error.
(0008254)
michal (reporter)
2008-11-10 16:00

> The problem you are seeing is due to the fact that the /etc/ssh/sshd_config is trying to listen on IPV6 and IPv4

Well, yes. I already suggested in "Additional Information" that 'AddressFamily inet' in configuration may help as this is supposed to make operations IPv4 only. Not sure about commenting out 'ListenAddress ::'. This looks like a default.

OTOH bumping up openssh version resolves the issue too. I used openssh-5.1p1-4 because from earlier experiments I knew that it does what I needed with Fedora 9 systems. As expected this is also true for CentOS. It is quite possible that something "in between" would be good enough.
(0008256)
michal (reporter)
2008-11-10 19:51

Yes, that is what I thought. A relevant fragment in a default sshd_config
looks like this:

#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

and with that I see in logs

 sshd[5224]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.

If I will put 'AddressFamily inet' then I have

 sshd[12420]: Server listening on 0.0.0.0 port 22.

while lines with 'Server listening on :: port 22' disappear. A possible workaround as long as you do not care about IPv6.

- Issue History
Date Modified Username Field Change
2008-11-10 05:35 michal New Issue
2008-11-10 05:35 michal Assigned To => kbsingh@karan.org
2008-11-10 14:38 smooge Note Added: 0008253
2008-11-10 16:00 michal Note Added: 0008254
2008-11-10 19:51 michal Note Added: 0008256


Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker