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 VPS Linux.

Change default SSH Port of VPS Linux

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 Linuz

  • Was this article Helpful ?
  • yes   no

Leave a Reply