GB Advisors, Inc.

PR: +1 (787) 708-6734
US: +1 (786) 272-2370

Tech Blog‎ > ‎

Simple Security - Changing SSH Default Port

posted Nov 15, 2011 8:54 PM by Alexander Guedez   [ updated Dec 1, 2011 9:38 AM ]




After installing an Internet Linux Server, one of the easiest ways to secure it and avoid making it a target of automatic attacks from bots its changing the default administration ports, like for example SSH. 


First make a copy of the SSH configuration file:

# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original

As root edit the SSH config file:

# vi /etc/ssh/sshd_config

Around line 12 in the file you'll find the Port number; change this to a different higher port that is not being used, for example: 24332. Save the new configuration.

Port 24332

Restart the service for the new port to be used:

# service sshd restart

Important Note: Check for firewall ports. By restarting the service the current connection will not be disconnected. Make sure you are able to connect to the new port before disconnecting. 

Enjoy and always think security.