error: Bind to port 22

Jason Montleon monty19 at hotmail.com
Mon Apr 26 17:45:46 UTC 2004


Well port 22 is generally used by ssh, but it appears that you have another
program that wants to listen on port 22 as well (you can only have one;
unless you intend to have each program listen on a different interfaces,
rather than having both try and listen on all.)

Your search 'lsof -i tcp |grep 22', was lucky in that the device number was
2252 and you caught the line; *:ssh is the address (*:ssh); all
interface/addresses on port ssh; port 22 was resolved to ssh, as far as I
know because it is listed in /etc/services:

ssh             22/tcp                          # SSH Remote Login Protocol
ssh             22/udp                          # SSH Remote Login Protocol

and sshd (on the far left) is the command that was run and is now listening
on port 22.

As for what to do; you can disable sshd using system-config-services and
reboot; don't do this if you're connecting remotely through ssh.  When you
reboot you'll've cut yourself off; do it at the system.  Run 'lsof -i' and
see what's trying to listen on 22/ssh.  Then you need to make up your mind.
Should it be trying to listen.  If not find out where it is trying to start
from and disable it.  If so which one do you want to keep listening on port
22 (or on port 22 on which interfaces) and which one are you going to have
listen on a different port (or interface)...

This should hopefully at least get your started in the right direction...

Did you per chance try to install some version of ssh after installing
Fedora with the version of ssh that comes with it and is enabled by default?

Jason




>While checking my security logs, I noticed this error

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

>after doing a search, I ran lsof to show the process occupying the port and
this is what I found

>[root]# lsof -i tcp |grep 22
>cupsd 831 root 0u IPv4 2232 TCP localhost.localdomain:ipp (LISTEN)
>sshd 1019 root 3u IPv4 2252 TCP *:ssh (LISTEN)

>Is this something I can ignore?





More information about the fedora-test-list mailing list