Comment 7 for bug 1993478

Revision history for this message
Christophe M. (chrism34) wrote :

Some additional info:

drop in settings from sshd.config.d seem to be applied normally, the issue seem to be only for IP binding and custom ports.

If I change Accept=no by Accept=yes in ssh.socket and reloads the socket unit, I can start sshd on a different port and I can also bind the IP to something else than ::

There's an issue still, an instance of sshd is still listening to :::22 that is not started by SSHD but by init.

root@ubuntulocal:~# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 568/vsftpd
tcp 0 0 0.0.0.0:622 0.0.0.0:* LISTEN 571/sshd: /usr/sbin
tcp 0 272 192.168.1.225:622 192.168.1.220:2473 ESTABLISHED 1027/sshd: root@pts
tcp6 0 0 :::22 :::* LISTEN 1/init

If I reboot after changing this no to yes in ssh.socket does not survive a reboot and fails to load sshd with a "Failed to queue service startup job" error.
Oct 21 15:41:56 ubuntulocal systemd[1]: ssh.socket: Failed to queue service startup job (Maybe the service file is missing or not a template unit?): Invalid argument
Oct 21 15:41:56 ubuntulocal systemd[1]: ssh.socket: Failed with result 'resources'.

I had to mask/stop the sshd.socket unit and create a custom sshd service in /etc/systemd/system to be able start sshd on a custom port and IP.