View Full Version : Bind to port 22 on failed error

14th November 2004, 03:30 PM
I've seen the following error in my security log since I installed FC3:

Nov 13 17:08:54 localhost sshd[2517]: Server listening on :: port 22.
Nov 13 17:08:54 localhost sshd[2517]: error: Bind to port 22 on failed: Address already in use.

Does anyone know why I am getting this error or how I can remedy it?

14th November 2004, 05:50 PM
Is it possible that you have another application that already tries to use port 22. Perhaps another
ssh deamon or one of your own apps? Is there any other mention of port 22 in your logs, perhaps right before the sshd error?

15th November 2004, 01:00 PM
Same error on mine. SSH is starting. The first line is it starting and binding to port 22 on ::. Since it already has started, the second line where it tries to bind again to port 22 on fails. The reason is that IPv6 and IPv4 are both enabled. SSH starts and binds on port 22 to all available IPv6 IPs (::). Then, it also tries to bind to all IPv4 IPs ( in case IPv6 is disabled, but the port is already bound. What I did to get rid of the error message was to add a ListenAddress line into /etc/ssh/sshd_config. For example, I only want SSH listening on my internal LAN so I add 'ListenAddress'.

8th June 2005, 12:09 PM
i have this same error in my logs from FC4 test 1.

i tried rebooting, FC4 test 1 shows SSH was OK during reboot,
but after logging in, and check the log, it shows the same line

error: Bind to port 22 on failed: Address already in use. etc etc.

so, i cant ssh from other machines, and i need to restart sshd service to do that.

weird case from FC4, i dont have this with FC1 to FC3...

10th June 2005, 01:42 PM
The first thing you should try is upgrading to FC4test3. If that doesn't help or you can't upgrade for some reason, post here again.

11th June 2005, 02:15 PM
also there's new openssh .. and ListenAddress whatever you like different from that should do the trick

12th July 2005, 06:18 PM

I am seeing the same error in the security log of my FC3 system.

any suggestions for FC3?


12th July 2005, 11:17 PM
As someone said earlier up this post, it's because :: is IPv6 address, and this is what SSH binds to when it first start's, being that IPv4 is also enabled, when it tries to bind to the IPv4 address, it find's that it is already being used.

Possibly disable IPv6 support in kernel (?) or use the ListenAddress option in your SSHD server config file.

13th July 2005, 12:32 AM
If you're not using IPv6, just disable it in sshd_config:

#ListenAddress ::

(or bind the ListenAddress to a specific IP)

10th September 2005, 03:50 AM
I also got this error, only after I unchecked SSH from the Trusted services under security level configuration. I'm trying to understand IP tables so I can drop any connection but the one's I want for SSH.

22nd September 2005, 11:04 PM
Disable IPv6 in the ssh config file and re-post if the problem persists. It looks like you are trying the bind to port 22 twice, once with IPv6 and again with IPv4.