Changing the default SSH port on your VPS – CentOS 5

This is not in anyway a game changer when it comes to security. But, 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:

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

    nano /etc/ssh/sshd_config

If you prefer to use vi, then simply change nano to vi.

Scroll down until you see the following line:

    #Port 22

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

    Port 5757

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

    service sshd reload

That’s it! Next time you SSH into your server, be sure to utilize the port 5757 instead of 22.

Leave a Reply

You must be logged in to post a comment.