Operating System - Linux
1828208 Members
2404 Online
109975 Solutions
New Discussion

Re: Getting a error in my /var/log/messages

 
SOLVED
Go to solution
Juan Gonzalez_2
Frequent Advisor

Getting a error in my /var/log/messages

I get this message in my /var/log/messages file saying "sshd[24939]: error: Bind to port 22 on :: failed: Address already in use. sshd[24939]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use."

I check the sshd daemon it is still running without any problems. I looked at the sshd_config file and line ListenAddress is commented.

What can be the problem why I am getting the error messages?
4 REPLIES 4
Ryan Goh
Frequent Advisor

Re: Getting a error in my /var/log/messages

This problem is due to ipv6 is enable on your syetem by default. You can disable by adding alias net-pf-10 off and
alias ipv6 off in /etc/modprobe.conf file.

If ipv6 is enable, when you do sshd debugging, it will test binding to ipv6 address first, follow by ipv4 address, is because only can bind port no to one ip address only. If ipv6 is disable, you will never get this error anymore.

If ip6 is enable, when you netstat -na, you will see "tcp 0 :::22 :::* LISTEN", if you ipv6 is diable you will see "tcp 0 0.0.0.0:22 0.0.0.0:* LISTEN".



g33k
Valued Contributor

Re: Getting a error in my /var/log/messages

hi it can also be problem with duplicity of starting...
once sshd is started by inetd and second time with /etc/rc.d/rc.sshd

so you can comment line with sshd in /etc/inetd.conf

or make /etc/rc.d/rc.sshd not executable...
chmod -x /etc/rc.d/rc.sshd
Atul Gautam
Valued Contributor
Solution

Re: Getting a error in my /var/log/messages

Hi Juan,

To permanently remove this problem, edit the file "/etc/ssh/sshd_config" and make sure that you have got the following entries at the starting point in file itself ---

Port 22
Protocol 2,1
ListenAddress 0.0.0.0:22

And after saving the contents, restart the service using the command --

# service sshd restart


----
Atul
Juan Gonzalez_2
Frequent Advisor

Re: Getting a error in my /var/log/messages

I figured out what the problems was.

Thanks to everyone that repsonded.
Juan Gonzalez