5Dec/074
Error: “bind to port 22 on 0.0.0.0 failed: Address already in use”
Yesterday I setup a Linux Centos server which then having problem with connection refused/dropped when I configuring it via SSH.I check the sshd log file, and see “Error: bind to port 22 on 0.0.0.0 failed: Address already in use” error message. Some web page I read said that it’s because IPv4 and IPv6 are both configured to listen SSH, we need to turn off one. Here is how to fix it:
/etc/ssh/sshd_config
Look for
Port 22 Protocol 2 #ListenAddress 0.0.0.0 #ListenAddress ::
If you use IPv4, uncomment this line:
ListenAddress 0.0.0.0
So it look like this:
Port 22 Protocol 2 ListenAddress 0.0.0.0 #ListenAddress ::
For IPv6, uncomment this one:
ListenAddress ::
So it look like this:
Port 22 Protocol 2 #ListenAddress 0.0.0.0 ListenAddress ::
May 25th, 2008 - 20:34
I’ve spent hours trying to find out… and it works like a charm now! Thanks!
July 24th, 2008 - 10:03
It’s not working for me, I still have this error
July 24th, 2008 - 13:13
@China P, what OS are you using? is it centos? have you tried restarting the sshd after you make the changes?
April 28th, 2011 - 21:26
Thanks a mill Markus works perfectly. Thanks a mill!