Change SSH Port - Ubuntu
-
vim /etc/ssh/sshd_config
Modify the Port to new port number (i.e: 23)
Port 23
Restart ssh service
/etc/init.d/ssh restart
If not working, modify file below;
vim /etc/systemd/system/sockets.target.wants/ssh.socket
Modify the "ListenStream" value to target (i.e: 23)
Restart systemctl daemon & ssh service
systemctl daemon-reload /etc/init.d/ssh restart
Ref: https://askubuntu.com/questions/1483893/unable-to-change-ssh-port-on-ubuntu