By default, SSH port is set to 22. However this SSH port digit is not really safe or secure because who doesn’t know it? So everyone can make guess trying to login to your SSH such as using Bruteforce SSH login.
Because of that, we surely need to elevate our SSH security, we need to change our SSH Port so only we know it. So to change SSH port, you can follow the instructions below:
- Login to your SSH via PuTTY, then enter your IP address on the Host Name column (or IP Address), then click the Open button.
- To login, just type root as username then enter your password by right clicking then paste it and hit Enter.
- The following is the interface of your SSH if you have successfully logged in. You can see the notification if there is fail login as many as 12713 since you last logged in.
- Now we change the SSH port digit so it will no longer use 22. The steps to do is by executing the command to change the 22 to be
65001, so copy the following code then paste it on PuTTY.
sed -i 's/#Port 22/Port 65001/' /etc/ssh/sshd_config
- Now you need to restart you SSH service by copying and pasting the following command on PuTTY and then hit Enter.
systemctl restart sshd
Or use the following command:
service sshd restart
- Once done, from now on and forward you can use the 65001 port.
- Now to test whether your changes have been applied, then try to re-login via PuTTY using the new port.
- The following is the SSH login appearance via PuTTY using the new port.
For more VestaCP tutorials you can find on that dedicated page.