Harden SSH Access (Change Port)

In this post/article i will describe how to increase your security to prevent hacking attacks from the SSH server. You should apply some configurations and tweaks on the SSH server to ensure the maximum security of your server.

Follow the below instructions:

  • Login to your server through SSH with root access.

Change SSH Port:

The first step of this tutorial is to change the default port of the SSH server. This is most usable way to protect your server from SSH attacks.
# nano /etc/ssh/sshd_config
  • Find the line in that page:
What ports, IP and Protocols we listen for
Port 22
  • Change the Port 22 to any integer you like e.g:
Port 2011
  • and save the configurations. Restart the SSH server:
# service sshd restart
Note: You should not use the port number that is already being used by another services

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>