Knowledgebase: Dedicated Hosting
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.


Steps To Change The SSH Port For Your Linux Server

1. Connect to your server via SSH (more info).

2. Run the following command:

vi /etc/ssh/sshd_config

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:

service sshd restart

7. Verify SSH is listening on the new port by connecting to it. Please check the egample given below:

ssh username@hostname.com -p 50873

50873 is the custom SSH port here. So, replace it with the port you have setup.







(1 vote(s))
Helpful
Not helpful

Comments (0)