Since ubuntu 22.10, openssh-server uses socket activation. You can read more at /usr/share/doc/openssh-server/README.Debian.gz
Copying here: Socket-based activation with systemd ------------------------------------ By default, socket-based activation is used on systems that use systemd. The provided ssh.socket unit file sets ListenStream=22. If you need to have it listen on a different address or port, then you will need to do this as follows (modifying ListenStream to match your requirements): mkdir -p /etc/systemd/system/ssh.socket.d cat >/etc/systemd/system/ssh.socket.d/listen.conf <<EOF [Socket] ListenStream=2222 EOF systemctl daemon-reload See systemd.socket(5) for details. If you do not want to use socket activation for ssh on your system, you can disable socket activation by running: systemctl disable --now ssh.socket systemctl enable --now ssh.service ** Package changed: ubuntu-release-upgrader (Ubuntu) => openssh (Ubuntu) ** Changed in: openssh (Ubuntu) Status: New => Invalid -- 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/2016950 Title: ubuntu 23.o4 新安装ssh默认端口修改不成功 Status in openssh package in Ubuntu: Invalid Bug description: ubuntu 23.04新安装的系统,安装openssh-server 后,修改默认22端口不成功。 ProblemType: Bug DistroRelease: Ubuntu 23.04 Package: ubuntu-release-upgrader-core 1:23.04.5 ProcVersionSignature: Ubuntu 6.2.0-20.20-generic 6.2.6 Uname: Linux 6.2.0-20-generic x86_64 ApportVersion: 2.26.1-0ubuntu2 Architecture: amd64 CasperMD5CheckResult: pass CrashDB: ubuntu CurrentDesktop: ubuntu:GNOME Date: Wed Apr 19 13:01:31 2023 InstallationDate: Installed on 2022-01-02 (471 days ago) InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20211105) PackageArchitecture: all SourcePackage: ubuntu-release-upgrader Symptom: ubuntu-release-upgrader UpgradeStatus: Upgraded to lunar on 2022-11-12 (158 days ago) VarLogDistupgradeXorgFixuplog: INFO:root:/usr/bin/do-release-upgrade running INFO:root:No xorg.conf, exiting mtime.conffile..etc.update-manager.release-upgrades: 2022-11-13T20:00:56.608141 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/2016950/+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