How To Change The SSH Port On Your Linux Server
Posted by vipin h, Last modified by
Undefined index: editedstaff (./__swift/cache/99a2018850e43fc96b722079625d25a8.php:44)
Copy to clipboard:
on 08 June 2018 04:47:53 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 -p 50873

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

(1 vote(s))
Not helpful

Comments (0)