Public bug reported:

openssh-server tries to restart itself, but openssh-server reports port
22 in use. This is true: systemd has taken port 22 to start sshd if one
connects to port 22.

two solutions:
1. dont start sshd after installing.
   configure it without starting it afterwards.
2. stop systemd listening on port 22
   before starting sshd, then start sshd,
   terminate it after configuring, then
   start systemd listening on port 22 again.

Second problem:
starting ssh.service does not check if "/run/sshd" exists. This directory has 
to be created before sshd is started. Unclear if this is an error with sshd not 
creating this directory before dropping privileges or if this has to be done 
once while installing. IMHO the first is the case.


Workaround:
systemctl stop ssh.service
systemctl disable ssh.service
apt upgrade
systemctl enable ssh.service
killall sshd
mkdir /run/sshd
systemctl start ssh.service

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: openssh-server 1:8.4p1-6ubuntu2.1
ProcVersionSignature: Ubuntu 5.13.0-23.23-generic 5.13.19
Uname: Linux 5.13.0-23-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu71
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: XFCE
Date: Tue Jan 11 19:11:47 2022
InstallationDate: Installed on 2021-08-18 (146 days ago)
InstallationMedia: Xubuntu 21.04 "Hirsute Hippo" - Release amd64 (20210420)
SSHDConfig: Error: command ['pkexec', '/usr/sbin/sshd', '-T'] failed with exit 
code 255: Missing privilege separation directory: /run/sshd
SourcePackage: openssh
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: openssh (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug impish

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1957104

Title:
  updating openssh-server fails, because port 22 is in use by systemd

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1957104/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to