How To Change The SSH Port On Your Linux Server
Posted by vipin h, Last modified by vipin h on 08 June 2018 04:51:22 PM
The Secure Shell (SSH) Protocol by default uses port 22. It is better to setup a custom SSH port on your VPS/Dedicated servers because, this will stop many automated attacks towards the default SSH port 22.|
1. Connect to your server via SSH (more info).
Steps To Change The SSH Port For Your Linux Server
2. Run the following command:
3. Locate the following line:
# Port 22
5. Remove # and change 22 to your desired port number.
6. Restart the sshd service by running the following command:
7. Verify SSH is listening on the new port by connecting to it. Please check the egample given below:
ssh email@example.com -p 50873
50873 is the custom SSH port here. So, replace it with the port you have setup.