I also verified the fix using a fresh noble container:

root@n:~# apt policy openssh-server
openssh-server:
  Installed: 1:9.6p1-3ubuntu13.13
  Candidate: 1:9.6p1-3ubuntu13.13
  Version table:
 *** 1:9.6p1-3ubuntu13.13 100
        100 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1:9.6p1-3ubuntu13.12 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
     1:9.6p1-3ubuntu13.11 500
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
     1:9.6p1-3ubuntu13 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages

1. Check the default:

root@n:~# lsof -i :22
COMMAND PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
systemd   1 root   47u  IPv4 2258326      0t0  TCP *:ssh (LISTEN)
systemd   1 root   48u  IPv6 2258327      0t0  TCP *:ssh (LISTEN)

2. Check that AddressFamily works for IPv4 only:

root@n:~# echo "AddressFamily inet" >> /etc/ssh/sshd_config.d/custom.conf
root@n:~# systemctl daemon-reload
root@n:~# systemctl restart ssh.socket
root@n:~# lsof -i :22
COMMAND PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
systemd   1 root   47u  IPv4 2259275      0t0  TCP *:ssh (LISTEN)

3. Check that AddressFamily works for IPv6 only (with a non-default port
for good measure):

root@n:~# echo "AddressFamily inet6" > /etc/ssh/sshd_config.d/custom.conf
root@n:~# echo "Port 1234" >> /etc/ssh/sshd_config.d/custom.conf
root@n:~# systemctl daemon-reload
root@n:~# systemctl restart ssh.socket
root@n:~# lsof -i :1234
COMMAND PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
systemd   1 root   47u  IPv6 2263137      0t0  TCP *:1234 (LISTEN)
root@n:~# lsof -i :22

4. Lastly, the new dep8 tests added are passing, e.g.
https://autopkgtest.ubuntu.com/results/autopkgtest-
noble/noble/arm64/o/openssh/20250702_155647_cf67f@/log.gz:

2090s autopkgtest [15:52:15]: test sshd-socket-generator: preparing testbed
2090s Reading package lists...
2090s Building dependency tree...
2090s Reading state information...
2090s Starting pkgProblemResolver with broken count: 0
2090s Starting 2 pkgProblemResolver with broken count: 0
2090s Done
2091s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2092s autopkgtest [15:52:17]: test sshd-socket-generator: 
[-----------------------
2092s test_default...PASS
2092s test_custom_port...PASS
2092s test_default_and_custom_port...PASS
2092s test_mutiple_custom_ports...PASS
2092s test_custom_listenaddress...PASS
2092s test_custom_listenaddress_and_port...PASS
2092s test_custom_ipv6_listenaddress...PASS
2092s test_match_on_port...PASS
2092s test_custom_family_ipv4...PASS
2092s test_custom_family_ipv6...PASS
2092s test_custom_port_and_family_ipv4...PASS
2092s test_custom_port_and_family_ipv6...PASS
2093s autopkgtest [15:52:18]: test sshd-socket-generator: 
-----------------------]
2093s autopkgtest [15:52:18]: test sshd-socket-generator:  - - - - - - - - - - 
results - - - - - - - - - -

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

Title:
  sshd cannot bind to IPv4 interfaces

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to