To change the port of the SSH server, the systemd configuration for ssh.socket must be changed or supplemented. The configuration adjustment is made by creating a *.conf file in the directory /etc/systemd/system/ssh.socket.d/ (if the directory does not exist, create it with the root user).
Source: How to change the SSH server port on Ubuntu? – Server Fault
JFC!
Needed to configure ssh to listen on a different port on a new Ubuntu server 24.04. Have done this many times before editing ssh_config. But this time nothing happened. The server wasn’t accepting the change. Googled and googled all night until I found out that systemd took over the god damned opening of ports away from openssh config.
I have other Ubuntu 24.04 installations that don’t do this so this is new and finding this new systemd fuck up hasn’t propagated the search engines. 14 year old answers don’t cut it anymore.
Still pissed off even though this site fixed the problem. Systemd sucks!
Had to get this off my chest.