Is sshd not accessible at all over ipv4? How did you notice that sshd
was not listening on ipv4?

In the default case, we should end up with ssh.socket listening on
[::]:22, but with IPV6_V6ONLY=0 so that sshd is still accessible over
ipv4.

> Setting net.ipv6.bindv6only=0 also helps, but that's not a solution.

I think this is the default on Ubuntu, no?

If your system does have net.ipv6.bindv6only=1, and you don't want to
change it, a workaround for now should be to do:

$ mkdir -p /etc/systemd/systemd/ssh.socket.d/
$ cat > /etc/systemd/system/ssh.socket.d/bindipv6only-both.conf << EOF
[Socket]
BindIPv6Only=both
EOF

which has the effect of setting IPV6_V6ONLY to 0 for this particular
socket.

We should probably fix sshd-socket-generator to automatically do this in
certain cases.

** Changed in: openssh (Ubuntu)
   Importance: Undecided => Medium

** Changed in: openssh (Ubuntu)
       Status: New => Incomplete

** Changed in: openssh (Ubuntu)
       Status: Incomplete => Confirmed

** Tags added: rls-nn-incoming

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

Title:
  sshd cannot bind to IPv4 interfaces

Status in openssh package in Ubuntu:
  Confirmed

Bug description:
  After upgrading from 22.04 to 24.04 I noticed that my sshd only
  listening on IPv6 interface (::), while previously it was listening
  both IPv4 (0.0.0.0) and IPv6 (::). I tried to explicitly specify
  ListenAddress 0.0.0.0 (assuming it would bind to IPv4 only) but after
  restart sshd was still listening on IPv6 only.

  This problem affects other packages as well, for example, openvpn.

  Rebuilding applications from sources seems to fix the issue.

  Setting net.ipv6.bindv6only=0 also helps, but that's not a solution.

  ProblemType: Bug
  DistroRelease: Ubuntu 24.04
  Package: openssh-server 1:9.6p1-3ubuntu13.5
  ProcVersionSignature: Ubuntu 6.8.0-41.41-generic 6.8.12
  Uname: Linux 6.8.0-41-generic x86_64
  ApportVersion: 2.28.1-0ubuntu3.1
  Architecture: amd64
  CasperMD5CheckResult: unknown
  Date: Tue Sep 10 16:45:54 2024
  ProcEnviron:
   LANG=C.UTF-8
   PATH=(custom, no user)
   SHELL=/bin/bash
   TERM=screen.xterm-256color
  SourcePackage: openssh
  UpgradeStatus: Upgraded to noble on 2024-09-10 (0 days ago)

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


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to