If we start to modify the default port, even if we need to guess and crack the password, we need to find the port, at least to increase the difficulty of the VPS intrusion, in this article, the old Chiang will share how to modify the VPS default SSH port.
The first step, vi/etc/ssh/sshd_config
Using Xshell or Putty login VPS, the default VPS is typically 22 ports, and then enter Vi/etc/ssh/sshd_config will see such an interface.
All we need to do is change the 22 number to any 5 digits (this is a bit more appropriate).
Step two, reboot SSH
After we have modified and exited the above, we need to reboot SSH before it can take effect.
#centos
/etc/init.d/sshd restart
#debian或者ubuntu
/etc/init.d/ssh restart
If we are using a CentOS system or a debian/ubuntu, reboot ssh with a different command.
In this way, after the reboot, the default port changes, we can use the new port login ssh, or SFTP, so that security is much better than the default
Friendly tip: If we modify the SSH port remember to need to add your port in the Iptalbes firewall, otherwise you cannot log in.