The default port 22 is used to connect SSH to Linux Server, so more people will take advantage of this to find a way to attack the root account of the VPS.
To increase the security of a VPS, you should change SSH login port on the VPS instead of using the default port 22.
The steps change SSH login port:
– Login as root user on VPS
– Edit the sshd_config file
– Search #Port line 22, remove the # at the beginning and replaced by the port you want to use, for example 2222 (this port is used on Windows rather than Linux)
Note that the port should be free and not have to use the service to avoid conflict. See also TCP and UDP port list.
– Save the file and restart sshd
– If you use a firewall, you remember to enable this port to connect before logout.
That’s done, please relogin using SSH new port.