Kazila

Changing the default SSH port on your VPS – CentOS 5

This is not in anyway a game changer when it comes to security buy by simply changing your SSH port you can cut down on over 95% of automated brute force attempts. By default SSH utilizes the port 22; here’s how to change it to something else on CentOS:

Login into SSH and edit the sshd_config file which is located in /etc/ssh/.

1
nano /etc/ssh/sshd_config

Scroll down until you see the following line:

1
#Port 22

Delete the # symbol and change the 22 to a different port to your liking. It should look like this:

1
Port 5757

Save the file (CTRL-X), Y, and then enter. Finally, you just need to restart SSH

1
service sshd reload

Afterwards, it’s important to make sure you open up a new window and attempt to login to your virtual machine using the new port. If you messed things up, you can always login to SolusVM and update your configuration via console.

Posted by on April 15, 2011 in Tutorials