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)

Step1:

vi /etc/ssh/sshd_config file and look for line Port 22 and change line to Port 2233. 

Step2:

Restart sshd server.

systemctl restart sshd

Step3:

Sshd is running on a non-standard port, 2233. When you want to ssh login to it. Try:

$ ssh -p 2233 user@your-ip

OR

$ ssh -p 2233 This email address is being protected from spambots. You need JavaScript enabled to view it.

Where,

  • -p: Port to connect to on the remote host.