hp-support-head-portlet

Actions
Loading...

HP Support

hp-contact-secondary-navigation-portlet

Actions
Loading...

hp-share-print-widget-portlet

Actions
Loading...

hp-concentra-wrapper-portlet

Actions
Loading...

Red Hat Enterprise Linux 5 (RHEL 5) - Error: Bind to port 22 on 0.0.0.0 failed: Address already in use

Issue
SSH connection not established. Below errors thrown in /var/log/secure.
Dec 31 10:24:54 server007 sshd[9722]: Server listening on :: port 22
Dec 31 10:24:54 server007 sshd[9722]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Solution
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 0.0.0.0 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 (0.0.0.0) in case IPv6 is disabled, but the port is already bound.
To get rid of the error message is to add a ListenAddress line into /etc/ssh/sshd_config.
For example, if only SSH listening is wanted on the internal LAN, add "ListenAddress 192.168.0.1"
From sshd_config:
<snip> #Port 22 #Protocol 2,1 Protocol 2 #AddressFamily any #ListenAddress 0.0.0.0 ListenAddress 192.168.0.1 <snip> eth0      Link encap:Ethernet  HWaddr D4:85:64:4B:49:00           inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0           inet6 addr: fb70::f595:37bb:234b:4934/64 Scope:Link     < ------- This shows that IPV6 is enabled.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:2261 errors:0 dropped:0 overruns:0 frame:0           TX packets:3647 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:152291 (148.7 KiB)  TX bytes:868672 (848.3 KiB)           Interrupt:219
Resolution:
Disable IPV6 and reboot the system to resolve this issue.

hp-feedback-input-portlet

Actions
Loading...

hp-online-communities-portlet

Actions
Loading...

Prefer to troubleshoot on your own?

Consumer Community

Consumer Community

Join the conversation! Find Solutions, ask questions, and share advice with other HP product owners. Visit now >

Enterprise Business Community

Enterprise Business Community

Join HP's community of business and IT professionals to help solve problems, exchange ideas, and learn best practices from your peers. Worldwide discussions in English. Visit now >


hp-feedback-banner-portlet

Actions
Loading...

hp-country-locator-portlet

Actions
Loading...
Country: United States

hp-detect-load-my-device-portlet

Actions
Loading...