As expected, on reboot all is fine for the service status
ubuntu@node-horsea:~$ systemctl status ssh.service
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; disabled; preset: enabled)
Drop-In: /etc/systemd/system/ssh.service.d └─00-socket.conf
Active: active (running) since Thu 2023-02-02 10:54:40 UTC; 12min ago
TriggeredBy: ● ssh.socket
Docs: man:sshd(8) man:sshd_config(5)
Process: 2689 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 2690 (sshd)
Tasks: 1 (limit: 38220)
Memory: 5.3M
CPU: 894ms
CGroup: /system.slice/ssh.service
└─2690 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
Feb 02 11:06:27 node-horsea sshd[14629]: Accepted publickey for ubuntu from 10.172.196.173 port 47348 ssh2: RSA SHA256:KyONnhWWzlbscZNTHPZ25GWCXDQY5u/UD72EtQcwtqU
Feb 02 11:06:27 node-horsea sshd[14629]: pam_unix(sshd:session): session opened for user ubuntu(uid=1000) by (uid=0)
Feb 02 11:06:27 node-horsea sshd[14629]: pam_env(sshd:session): deprecated reading of user environment enabled
Feb 02 11:06:58 node-horsea sshd[14735]: Accepted publickey for ubuntu from 10.172.196.173 port 55016 ssh2: RSA SHA256:KyONnhWWzlbscZNTHPZ25GWCXDQY5u/UD72EtQcwtqU
Feb 02 11:06:58 node-horsea sshd[14735]: pam_unix(sshd:session): session opened for user ubuntu(uid=1000) by (uid=0)
Feb 02 11:06:59 node-horsea sshd[14735]: pam_env(sshd:session): deprecated reading of user environment enabled
Feb 02 11:07:03 node-horsea sshd[14796]: Accepted publickey for ubuntu from 10.172.196.173 port 57034 ssh2: RSA SHA256:KyONnhWWzlbscZNTHPZ25GWCXDQY5u/UD72EtQcwtqU
Feb 02 11:07:03 node-horsea sshd[14796]: pam_unix(sshd:session): session opened for user ubuntu(uid=1000) by (uid=0)
Feb 02 11:07:03 node-horsea sshd[14796]: pam_env(sshd:session): deprecated reading of user environment enabled
Feb 02 11:07:03 node-horsea sshd[14796]: pam_unix(sshd:session): session closed for user ubuntu
ubuntu@node-horsea:~$ systemctl status ssh.socket
● ssh.socket - OpenBSD Secure Shell server socket
Loaded: loaded (/lib/systemd/system/ssh.socket; enabled; preset: enabled)
Active: active (running) since Thu 2023-02-02 10:54:21 UTC; 12min ago
Until: Thu 2023-02-02 10:54:21 UTC; 12min ago
Triggers: ● ssh.service
Listen: [::]:22 (Stream)
Tasks: 0 (limit: 38220)
Memory: 8.0K
CPU: 894us
CGroup: /system.slice/ssh.socket
Feb 02 10:54:21 node-horsea systemd[1]: Listening on OpenBSD Secure Shell server socket.
And out of this condition it can even complete the package configuration.
ubuntu@node-horsea:~$ sudo dpkg-reconfigure openssh-server
/usr/sbin/dpkg-reconfigure: openssh-server is broken or not fully installed
ubuntu@node-horsea:~$ sudo apt-get install --fix-broken
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up openssh-server (1:9.0p1-1ubuntu8) ...
Replacing config file /etc/ssh/sshd_config with new version
Replacing config file /etc/ssh/sshd_config with new version
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable ssh
Warning: Stopping ssh.service, but it can still be activated by:
ssh.socket
rescue-ssh.target is a disabled or a static unit not running, not starting it.
ubuntu@node-horsea:~$ echo $?
0
As expected, on reboot all is fine for the service status
ubuntu@ node-horsea: ~$ systemctl status ssh.service system/ ssh.service; disabled; preset: enabled) system/ ssh.service. d
└ ─00-socket. conf
man: sshd_config( 5) /usr/sbin/ sshd -t (code=exited, status=0/SUCCESS) slice/ssh. service
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/
Drop-In: /etc/systemd/
Active: active (running) since Thu 2023-02-02 10:54:40 UTC; 12min ago
TriggeredBy: ● ssh.socket
Docs: man:sshd(8)
Process: 2689 ExecStartPre=
Main PID: 2690 (sshd)
Tasks: 1 (limit: 38220)
Memory: 5.3M
CPU: 894ms
CGroup: /system.
└─2690 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
Feb 02 11:06:27 node-horsea sshd[14629]: Accepted publickey for ubuntu from 10.172.196.173 port 47348 ssh2: RSA SHA256: KyONnhWWzlbscZN THPZ25GWCXDQY5u /UD72EtQcwtqU sshd:session) : session opened for user ubuntu(uid=1000) by (uid=0) sshd:session) : deprecated reading of user environment enabled KyONnhWWzlbscZN THPZ25GWCXDQY5u /UD72EtQcwtqU sshd:session) : session opened for user ubuntu(uid=1000) by (uid=0) sshd:session) : deprecated reading of user environment enabled KyONnhWWzlbscZN THPZ25GWCXDQY5u /UD72EtQcwtqU sshd:session) : session opened for user ubuntu(uid=1000) by (uid=0) sshd:session) : deprecated reading of user environment enabled sshd:session) : session closed for user ubuntu node-horsea: ~$ systemctl status ssh.socket system/ ssh.socket; enabled; preset: enabled) slice/ssh. socket
Feb 02 11:06:27 node-horsea sshd[14629]: pam_unix(
Feb 02 11:06:27 node-horsea sshd[14629]: pam_env(
Feb 02 11:06:58 node-horsea sshd[14735]: Accepted publickey for ubuntu from 10.172.196.173 port 55016 ssh2: RSA SHA256:
Feb 02 11:06:58 node-horsea sshd[14735]: pam_unix(
Feb 02 11:06:59 node-horsea sshd[14735]: pam_env(
Feb 02 11:07:03 node-horsea sshd[14796]: Accepted publickey for ubuntu from 10.172.196.173 port 57034 ssh2: RSA SHA256:
Feb 02 11:07:03 node-horsea sshd[14796]: pam_unix(
Feb 02 11:07:03 node-horsea sshd[14796]: pam_env(
Feb 02 11:07:03 node-horsea sshd[14796]: pam_unix(
ubuntu@
● ssh.socket - OpenBSD Secure Shell server socket
Loaded: loaded (/lib/systemd/
Active: active (running) since Thu 2023-02-02 10:54:21 UTC; 12min ago
Until: Thu 2023-02-02 10:54:21 UTC; 12min ago
Triggers: ● ssh.service
Listen: [::]:22 (Stream)
Tasks: 0 (limit: 38220)
Memory: 8.0K
CPU: 894us
CGroup: /system.
Feb 02 10:54:21 node-horsea systemd[1]: Listening on OpenBSD Secure Shell server socket.
And out of this condition it can even complete the package configuration.
ubuntu@ node-horsea: ~$ sudo dpkg-reconfigure openssh-server dpkg-reconfigur e: openssh-server is broken or not fully installed node-horsea: ~$ sudo apt-get install --fix-broken sshd_config with new version sshd_config with new version systemd- sysv-install. systemd- sysv-install disable ssh node-horsea: ~$ echo $?
/usr/sbin/
ubuntu@
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up openssh-server (1:9.0p1-1ubuntu8) ...
Replacing config file /etc/ssh/
Replacing config file /etc/ssh/
Synchronizing state of ssh.service with SysV service script with /lib/systemd/
Executing: /lib/systemd/
Warning: Stopping ssh.service, but it can still be activated by:
ssh.socket
rescue-ssh.target is a disabled or a static unit not running, not starting it.
ubuntu@
0