sshd start fails with:"fatal: Cannot bind any address." but the process return value 0 !

Istvan Viczian vici at dof.se
Fri Jan 23 07:21:06 EST 2004


Hi,
  	
I use openssh version:
OpenSSH_3.7.1p2, SSH protocols 1.5/2.0, OpenSSL 0.9.6l 04 Nov 2003
(complied by myself) on redhat7.2 ( kernel 2.4.20-19.7smp )

It seems that sshd returns vith wrong returns value, if some other
process (e.g. another sshd) already reserved the given IP address and
port.

I setup two ssh daemon almost with the same settings in order to listen 
on two different IP address, but at the first one I forgot to specify 
the IP address on which it have to listen to
(ListenAddress XXXXX). That is why it started on both of the available 
IP addreses (10.0.0.1, 10.0.0.2) :

[root at mach]#sshd -f /etc/ssh/sshd_config; echo $?
[root at mach]#0

And the log looks like:

   Jan 22 21:13:15 mach sshd[1644]: debug1: Bind to port 22 on 0.0.0.0.
   Jan 22 21:13:15 mach sshd[1644]: Server listening on 0.0.0.0 port 22.

Then I started the second too:

[root at mach]#sshd -f /etc/ssh2/sshd_config; echo $?
[root at mach]#0

And the log:

   Jan 22 21:15:06 mach sshd[1817]: debug1: Bind to port 22 on 10.0.0.2.
   Jan 22 21:15:06 mach sshd[1817]: error: Bind to port 22 on 10.0.0.2 
  failed: Address already in use.
   Jan 22 21:15:06 mach sshd[1817]: fatal: Cannot bind any address.

Obviously only the first instance was runing.


Regards,
Istvan Viczian





More information about the openssh-unix-dev mailing list