← Back to team overview

debcrafters-packages team mailing list archive

[Bug 2118912] Re: openssh-server unavailable after upgrade to 1:9.6p1-3ubuntu13.13

 

Yes, I can understand the frustration here. The sshd socket activation
feature in Ubuntu has evolved since it was first introduced in 22.10,
and is finally settling now. However, I think this patch was still
important to make so that we could fix bug 2080216, and to align the
systemd unit defaults with the non-socket activated defaults in sshd.

I think a large part of the misunderstanding here is around systemd
socket's ListenStream= option itself. Setting e.g. ListenStream=1234 has
*always* meant "listen on port 1234 on ipv6", and "depending on the
value of BindIPv6Only= this might result in the service being available
via both IPv6 and IPv4 (default) or just via IPv6." [1]

Hence, while adding custom overrides in
/etc/systemd/systemd/ssh.socket.d/ etc. has always been supported, it is
an advanced use case, and should be done with care. Most users should
use the ListenAddress, Port, and AddressFamily options in
/etc/ssh/sshd_config.d/ directly. In other words, if one wanted to add
an override and ensure that sshd is listening on port 1234 on ipv4, it's
more accurate to use ListenStream=0.0.0.0:1234 (or
ListenStream=[::]:1234 for ipv6), not ListenStream=1234.

Again, I understand the frustration, but I hope the information above
provides helpful detail and context around the issue.

[1]
https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html#ListenStream=

-- 
You received this bug notification because you are a member of
Debcrafters packages, which is subscribed to openssh in Ubuntu.
https://bugs.launchpad.net/bugs/2118912

Title:
  openssh-server unavailable after upgrade to 1:9.6p1-3ubuntu13.13

Status in openssh package in Ubuntu:
  Invalid

Bug description:
  Ubuntu release: Ubuntu 24.04.2 LTS
  Package affected version: openssh-server:1:9.6p1-3ubuntu13.13

  -------

  After upgrading openssh-server:1:9.6p1-3ubuntu13.11 and openssh-
  server:1:9.6p1-3ubuntu13.12 to openssh-server:1:9.6p1-3ubuntu13.13
  using unattended upgrades I found my Ubuntu 24 server unreachable via
  ssh.

  During intial setup I changed my ssh configuration adding TCP 1221 to
  its binding ports, to make that I followed these steps:

  cat << EOF > /etc/ssh/sshd_config.d/custom.conf
  Port 1221
  Port 22
  PermitRootLogin no
  PasswordAuthentication no
  EOF

  systemctl edit ssh.socket

  # adding these lines
  [Socket]
  ListenStream=
  ListenStream=22
  ListenStream=1221

  If I don't add any of those configuration changes to ssh.service and
  ssh.socket ssh is still available on standard tcp port 22 after
  upgrading to version 1:9.6p1-3ubuntu13.13.

  I I add those changes AFTER upgrading to version 1:9.6p1-3ubuntu13.13
  the problem still occurr and ssh will become unavailable.

  Downgrade to previous version (1:9.6p1-3ubuntu13.11 or
  1:9.6p1-3ubuntu13.12 fixes the problem without changing any of the
  previous customizations.

  Syntax to downgrade:
  sudo apt update; sudo apt install -y openssh-client=1:9.6p1-3ubuntu13.11 openssh-server=1:9.6p1-3ubuntu13.11 openssh-sftp-server=1:9.6p1-3ubuntu13.11

  Steps to reproduce the problem on a new Ubuntu instance (tested both on AWS EC2 and GCP instances):
  1. create a new instance based on Ubuntu 24LTS AMI
  2. add TCP port 1221 (or any port you want) to ssh binding

  cat << EOF > /etc/ssh/sshd_config.d/custom.conf
  Port 1221
  Port 22
  PermitRootLogin no
  PasswordAuthentication no
  EOF

  systemctl edit ssh.socket

  # add these lines
  [Socket]
  ListenStream=
  ListenStream=22
  ListenStream=1221

  systemctl restart ssh.service ssh.socket

  3. check ssh is available on TCP 22 and TCP 1221 (check firewall or security group)
  4. upgrade system packages (make sure to upgrade openssh-server to version 1:9.6p1-3ubuntu13.13
  sudo apt update ; sudo apt upgrade -y
  5. sudo shutdown -r now
  6. ssh unavailable after reboot but ssh.service and ssh.socket do not show any error or problem whatsoever.

  Thanks

  Tas

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



References