4
rated 0 times
[
4]
[
0]
/ answers: 1 / hits: 4656
/ 3 Years ago, mon, september 13, 2021, 3:43:35
Brand new ubuntu installation:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
ssh.service
fails to startup due to port 22 already in use:
$ sudo service ssh status
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-02-04 14:10:27 CST; 11min ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 2041 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Process: 2042 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255/EXCEPTION)
Main PID: 2042 (code=exited, status=255/EXCEPTION)
Feb 04 14:10:27 ubu20a systemd[1]: Starting OpenBSD Secure Shell server...
Feb 04 14:10:27 ubu20a sshd[2042]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Feb 04 14:10:27 ubu20a sshd[2042]: error: Bind to port 22 on :: failed: Address already in use.
Feb 04 14:10:27 ubu20a sshd[2042]: fatal: Cannot bind any address.
Feb 04 14:10:27 ubu20a systemd[1]: ssh.service: Main process exited, code=exited, status=255/EXCEPTION
Feb 04 14:10:27 ubu20a systemd[1]: ssh.service: Failed with result 'exit-code'.
Feb 04 14:10:27 ubu20a systemd[1]: Failed to start OpenBSD Secure Shell server.
Only thing I see listening on port 22 is 1/init
:
$ sudo netstat -tulpen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 101 34051 556/systemd-resolve
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 0 37066 745/cupsd
tcp6 0 0 :::22 :::* LISTEN 0 34718 1/init
udp 0 0 0.0.0.0:5353 0.0.0.0:* 115 37068 743/avahi-daemon: r
udp 0 0 0.0.0.0:52172 0.0.0.0:* 115 37070 743/avahi-daemon: r
udp 0 0 127.0.0.53:53 0.0.0.0:* 101 34047 556/systemd-resolve
udp 0 0 0.0.0.0:631 0.0.0.0:* 0 39715 822/cups-browsed
udp6 0 0 :::5353 :::* 115 37069 743/avahi-daemon: r
udp6 0 0 :::39012 :::* 115 37071 743/avahi-daemon: r
While I can get ssh.service
to startup on an alternate port (eg, port 2020) I'd like to understand, and fix (if possible), this current issue with port 22.
NOTES:
- linux sysadmin is not my strong point so if I'm missing something stupidly obvious ... go ahead and shoot the messenger
- if the answer is
RTFM
then a link to whichFMTR
would be appreciated - I looked through the first dozen or so suggested 'duplicate' questions but didn't find anything applicable to this issue
More From » 20.04