openssh-server-1:9.2p1-2ubuntu1 cannot be installed from active ssh session
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openssh (Ubuntu) |
Fix Released
|
Medium
|
Nick Rosbrook |
Bug Description
Installation seems to fail on restarting ssh.socket via systemctl
Setting up openssh-server (1:9.2p1-2ubuntu1) ...
rescue-ssh.target is a disabled or a static unit not running, not starting it.
Could not execute systemctl: at /usr/bin/
dpkg: error processing package openssh-server (--configure):
installed openssh-server package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ systemctl status ssh.socket
× ssh.socket - OpenBSD Secure Shell server socket
Loaded: loaded (/lib/systemd/
Active: failed (Result: resources) since Tue 2023-05-23 15:01:41 CEST; 48s ago
Duration: 3h 6min 36.071s
Triggers: ● ssh.service
Listen: [::]:22 (Stream)
CPU: 2ms
May 23 11:55:05 venus2 systemd[1]: Listening on ssh.socket - OpenBSD Secure Shell server socket.
May 23 15:01:41 venus2 systemd[1]: ssh.socket: Deactivated successfully.
May 23 15:01:41 venus2 systemd[1]: Closed ssh.socket - OpenBSD Secure Shell server socket.
May 23 15:01:41 venus2 systemd[1]: Stopping ssh.socket - OpenBSD Secure Shell server socket...
May 23 15:01:41 venus2 systemd[2631]: ssh.socket: Failed to create listening socket ([::]:22): Address already in use
May 23 15:01:41 venus2 systemd[1]: ssh.socket: Failed to receive listening socket ([::]:22): Input/output error
May 23 15:01:41 venus2 systemd[1]: ssh.socket: Failed to listen on sockets: Input/output error
May 23 15:01:41 venus2 systemd[1]: ssh.socket: Failed with result 'resources'.
May 23 15:01:41 venus2 systemd[1]: Failed to listen on ssh.socket - OpenBSD Secure Shell server socket.
At this point, sshd is no longer listening for new connections. A manual systemctl restart of ssh.socket fails with the same error. I am ssh-ed into this box, so I *think* the failure is because my session is already sitting on port 22, maybe? The only way I can be sure I will be able to ssh to this box again is to reboot it (so that ssh.socket can start cleanly).
$ lsb_release -rd
No LSB modules are available.
Description: Ubuntu Mantic Minotaur (development branch)
Release: 23.10
$ apt policy openssh-server
openssh-server:
Installed: 1:9.2p1-2ubuntu1
Candidate: 1:9.2p1-2ubuntu1
Version table:
*** 1:9.2p1-2ubuntu1 500
500 http://
100 /var/lib/
1:
500 http://
ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: openssh-server 1:9.2p1-2ubuntu1
ProcVersionSign
Uname: Linux 6.2.0-19-generic riscv64
ApportVersion: 2.26.1-0ubuntu3
Architecture: riscv64
CasperMD5CheckR
CloudArchitecture: riscv64
CloudBuildName: server
CloudID: nocloud
CloudName: unknown
CloudPlatform: nocloud
CloudSerial: 20230413.1
CloudSubPlatform: seed-dir (/var/lib/
Date: Tue May 23 14:58:35 2023
SSHDConfig: Error: command ['/usr/sbin/sshd', '-T'] failed with exit code 1: /etc/ssh/
SourcePackage: openssh
UpgradeStatus: Upgraded to mantic on 2023-05-12 (11 days ago)
tags: | added: rls-mm-incoming |
tags: | added: update-excuse |
Changed in openssh (Ubuntu): | |
assignee: | nobody → Nick Rosbrook (enr0n) |
status: | Confirmed → In Progress |
tags: | added: foundations-todo |
tags: | removed: rls-mm-incoming |
Changed in openssh (Ubuntu): | |
status: | In Progress → Fix Committed |
tags: | removed: foundations-todo |
How are you configuring sshd to run? It seems like you may have partially- configured socket-activated sshd. The postinst script should only try to resart ssh.socket if it was already enabled, which should not be the case if e.g. you reverted the socket-activation change. So, did you try and disable socket-activated sshd in the past?
The issue is not your active ssh session, because that is not the process that is listening on port 22.