Changing the SSH port on Linux
Moving sshd off the default port 22 is a classic first step when hardening a Linux server. It cuts down the noise from automated scanners hammering 22. A couple of quick edits and you're done.
bash
nano /etc/ssh/sshd_configFind the Port 22 line, change it to whatever port you want, and uncomment it.
Save and exit, then restart the SSH service:
Ubuntu:
bash
service ssh restartDebian / Ubuntu (systemd):
bash
systemctl restart sshCentOS:
bash
systemctl restart sshdOnce the service is back up, connect on the new port.