SSH server: Failed to start OpenBSD Secure Shell server

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.4
Virtualmin version 7.10.0

After the update to the kernel Linux 5.15.0, the SSH server has stopped and does not restart, here it is the the output from journalctl -xeu ssh.service:

An ExecStartPre= process belonging to unit ssh.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
May 10 09:18:58 mail.seomiotico.it systemd[1]: ssh.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit ssh.service has entered the 'failed' state with result 'exit-code'.
May 10 09:18:58 mail.seomiotico.it systemd[1]: Failed to start OpenBSD Secure Shell server.
░░ Subject: A start job for unit ssh.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit ssh.service has finished with a failure.
░░ 
░░ The job identifier is 4378 and the job result is failed.
May 10 09:18:58 mail.seomiotico.it systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ Automatic restarting of the unit ssh.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
May 10 09:18:58 mail.seomiotico.it systemd[1]: Stopped OpenBSD Secure Shell server.
░░ Subject: A stop job for unit ssh.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A stop job for unit ssh.service has finished.
░░ 
░░ The job identifier is 4462 and the job result is done.
May 10 09:18:58 mail.seomiotico.it systemd[1]: ssh.service: Start request repeated too quickly.
May 10 09:18:58 mail.seomiotico.it systemd[1]: ssh.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit ssh.service has entered the 'failed' state with result 'exit-code'.
May 10 09:18:58 mail.seomiotico.it systemd[1]: Failed to start OpenBSD Secure Shell server.
░░ Subject: A start job for unit ssh.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit ssh.service has finished with a failure.
░░ 
░░ The job identifier is 4462 and the job result is failed.

Anyone can help?

Thank you in advance.

You need to look at the log (journalctl -fu ssh) for why it’s failing. The status isn’t useful information.

Seems extremely unlikely to be related to the kernel upgrade.

Hi @Joe

here it is:

May 10 09:48:37 mail.seomiotico.it sshd[16416]: This private key will be ignored.
May 10 09:48:37 mail.seomiotico.it sshd[16416]: sshd: no hostkeys available -- exiting.
May 10 09:48:37 mail.seomiotico.it systemd[1]: ssh.service: Control process exited, code=exited, status=1/FAILURE
May 10 09:48:37 mail.seomiotico.it systemd[1]: ssh.service: Failed with result 'exit-code'.
May 10 09:48:37 mail.seomiotico.it systemd[1]: Failed to start OpenBSD Secure Shell server.
May 10 09:48:37 mail.seomiotico.it systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
May 10 09:48:37 mail.seomiotico.it systemd[1]: Stopped OpenBSD Secure Shell server.
May 10 09:48:37 mail.seomiotico.it systemd[1]: ssh.service: Start request repeated too quickly.
May 10 09:48:37 mail.seomiotico.it systemd[1]: ssh.service: Failed with result 'exit-code'.
May 10 09:48:37 mail.seomiotico.it systemd[1]: Failed to start OpenBSD Secure Shell server.

That’s the latest history in OS update:

Start-Date: 2024-05-10  09:10:47
Commandline: apt-get autoremove
Requested-By: corriere24 (1035)
Remove: libhiredis0.14:amd64 (0.14.1-2), proftpd-doc:amd64 (1.3.7c+dfsg-1build1)
End-Date: 2024-05-10  09:10:48

Start-Date: 2024-05-10  09:11:32
Commandline: apt upgrade
Requested-By: corriere24 (1035)
Upgrade: landscape-common:amd64 (19.12-0ubuntu13, 23.02-0ubuntu1~22.04.2), distro-info-data:amd64 (0.52ubuntu0.6, 0.52ubuntu0.7), linux-firmware:amd64 (20220329.git681281e4-0ubuntu3.29, 20220329.git681281e4-0ubuntu3.30)
End-Date: 2024-05-10  09:12:01

Before that I had to force the removal etckeeper through these commands:

sudo rm -rf /etc/etckeeper
sudo rm -f /etc/apt/apt.conf.d/60etckeeper
sudo dpkg --purge --force-all etckeeper

Regarding the now, I report that the host keys are present:

Selezione_009
Selezione_010

Can it be a solution in your opinion to replace the keys as explained here?

Look that you use Debian based distro. And maybe have corupted ssh server key. On-site as root use dpkg-reconfigure openssh-server. This create new server keys. And after restart openssh server.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.