LKBEN11664: Ubuntu ssh daemon does not startup. Cannot connect to sshd from a remote system.
Symptom
After some update I cannot ssh into the system anymore.
Cause
This might be some configuration problem.
Solution
The following error can be seen on the local system:
systemctl status -l ssh.service
× ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/ssh.service.d
└─00-socket.conf
Active: failed (Result: exit-code) since Thu 2023-05-18 17:02:19 CEST; 32min ago
TriggeredBy: × ssh.socket
Docs: man:sshd(8)
man:sshd_config(5)
Process: 2515 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255/EXCEPTION)
CPU: 8ms
When we run the following command, the rror is shown better:
sudo /usr/sbin/sshd -t
In case of my system, I got the following error message:
root@sysname:/etc/systemd/system# sshd -T
Missing privilege separation directory: /run/sshd
To solve the problem I created the directory that was missing as root.
mkdir /run/sshd
After restarting the ssh service, it was active and running. SSH sessions are possible from remote systems.
systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/ssh.service.d
└─00-socket.conf
Active: active (running) since Thu 2023-05-18 17:34:49 CEST; 8min ago
TriggeredBy: ● ssh.socket
Docs: man:sshd(8)
man:sshd_config(5)
Process: 5068 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 5069 (sshd)
Tasks: 1 (limit: 38221)
Memory: 1.5M
CPU: 41ms
CGroup: /system.slice/ssh.service
└─5069 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
Hope this troubleshooting might help you too.
Have fun.
Disclaimer:
The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!About the Author
Author:
- Keskon GmbH & Co. KGWim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.
Latest update: 18/05/2023