By default sshd (SSH Remote Login Protocol) server runs on tcp port 22. It's also easy for hackers to find your server and try something. However, if you change the default port 22 to other ports, and disable port scan, then less likely someone can figure it out your ssh port . This makes your servers more securier.
On the sshd server, there is one configuration called sshd_config that defines the default port.
How to setup sshd to run on a non-default port(22)
vi /etc/ssh/sshd_config file and look for line Port 22 and change line to Port 2233.
Restart sshd server.
systemctl restart sshd
Sshd is running on a non-standard port, 2233. When you want to ssh login to it. Try:
$ ssh -p 2233 [email protected]
- -p: Port to connect to on the remote host.