Change default SSH Port

As security has become the most important concern over Internet, you need to ensure best practices while managing your server. Well, changing the Default SSH Port to a different one is a part of Server Administration Best Practices. Here we’ve discussed how can one change default SSH Port of Linux VPS.

Change default SSH Port of Linux VPS

STEP 1: Login to your Cloud or VPS Linux using PuTTy

STEP 2: Once you’re logged in use the following command to navigate to SSH

cd /etc/ssh

STEP 3: Type the following command to open sshd_config file on VI Editor

vi sshd_config

STEP 4: Hit on ‘Insert’ on your keyboard to become able to edit the file

STEP 5: Search for Port 22. Change the port number according to your desired one. Remove ‘#’ from the starting of the line. Preserve the port number for further use.

STEP 6: Press ‘Exc’ on your keyboard. Then type


and hit enter. You’ve successfully edited sshd_config file

STEP 7: Now restart the service by using the following command

service sshd restart

All done! Your desired Port number now has been set for your Cloud or VPS.

We hope this tutorial helps you find the perfect solution. If your like our tutorials, definitely you’ll love our support. All VernalWeb hosting plans include 24/7 support from our amazing inhouse support staff. Check out our web hosting plans and have your website migrated today!

  • Was this article Helpful ?
  • yes   no

Leave a Reply