Change the default SSH port (CentOS, Debian, Ubuntu)

1 min read June 28, 2013 at 8:01pm on Tutorials

By changing your SSH port you can cut down on the majority of automated brute force attempts. By default SSH utilizes the port 22; here’s how to change it to something else:

Login into SSH as root and edit the sshd_config file using your favorite editor. The file is located in the /etc/ssh/ directory.

nano /etc/ssh/sshd_config

Scroll down until you see the following line:

#Port 22

Enable the line by removing the # symbol and adjust the port to your liking. The line should look like this:

Port 5757

Save the file in nano [CTRL+X , Y , ENTER]. Finally, you just need to reload SSH:

service sshd reload

On Debian or Ubuntu, you would use ssh instead:

sudo service ssh reload

Get started today. SIGN UP



Copyright Kazila 2017 © All Rights Reserved