In this tutorial, you will learn how you can change the SSH port of your VPS. This is useful to prevent unauthorized access to your server. It is an added security measure and highly recommended.
- Linux Server
- SSH Client (Putty Recommended)
- Text Editor (nano Recommended)
- Root Access
Steps to Change the SSH Port
1 – SSH into your Linux Server and Login as root.
2 – Run the following command:
3 – Locate the following in the file – # Port 22
4 – Remove # from the line and change 22 to the port you want.
5 – The final step is to restart the sshd service by running the following command:
service sshd restart
You have now changed the login port of your server.