How-To Change SSH Port

If you would like to help protect your site against brute-force attacks, start by changing your SSH Port. Here’s how:

1. Edit the ssh config file:

# sudo nano /etc/ssh/sshd_config

Find this line:

Port 22

Now simply change your port number from ’22’ to something else. ┬áJust make sure it’s not a port that is used for something else.

Port 1234

2. Restart SSH

# sudo /etc/init.d/ssh restart

3. Close your SSH session and re-establish, like this:

# ssh root@host -p 1234

Done.

Leave a Reply

Your email address will not be published. Required fields are marked *