Operating System - Linux
1827262 Members
2161 Online
109717 Solutions
New Discussion

sshd bind to port 22 fail

 
Tammy Liang
Regular Advisor

sshd bind to port 22 fail

I have a VM running RedHat ES4. I can not start sshd daemon due to port 22 is already used. I checked port 22 is not used before I started sshd daemon. Below is the error message I saw at secure file.
sshd: bind to port 22 on 0.0.0.0 failed: Address already in use.

I can ssh from the VM to itself. But not from other system to this VM. I got error message:
ssh: connect to host 123.122.121.13 port 22: No route to host.

Thanks for any help.
take easy, enjoy life
4 REPLIES 4
George Liu_4
Trusted Contributor

Re: sshd bind to port 22 fail

post

netstat -antp|grep 22

Tammy Liang
Regular Advisor

Re: sshd bind to port 22 fail

tcp 0 0 :::22 ::: * LISTEN 9467/sshd

9467 is PID for sshd
take easy, enjoy life
Ivan Krastev
Honored Contributor

Re: sshd bind to port 22 fail

Actually you have error "No route to host". Check your connection to VM. Try ping, traceroute, arp.

Also check routing table on VM for errors.


regards,
ivan
Matti_Kurkela
Honored Contributor

Re: sshd bind to port 22 fail

The ":::22" in the netstat output is IPv6-style for "listening on port 22 on all interfaces."

You have an IPv6-capable sshd already running (process ID 9467). The single process may be able to handle both IPv4 and IPv6 connections, but it will probably display even the IPv4 addresses in IPv6 style. This may be slightly confusing, but harmless.

When you ssh from the VM to itself, you may be actually using IPv6 locally. This might explain why the localhost connection works.

There might be something wrong with your IPv4 settings, which would explain why you cannot connect to the VM from other systems.

From the information you've provided so far I cannot determine what the problem might be.
MK