Attempt to move your SSH to a different port to deter individuals without specific knowledge of your server from easily discovering your SSH port. Most visitors typically search on port 22, which is the default SSH port.
Always use ports below 1024, as these are privileged ports accessible only to root. Any port above 1024 can be used by anyone.
To move your SSH to a different port, log in to your server command line as root and open ‘sshd_config‘.
nano /etc/ssh/sshd_config
Discard and adapt:
Port 22
to
Port 102
then restart sshd:
service sshd restart
For instance, we have set port 102 as the default SSH port instead of 22.
Note: It is crucial to allow the new port in the server firewall. Ensure not to close the current SSH connection while testing the new port to avoid any unintended disruptions.