Configuring the SSH protocol to make it more secure

Although we have been talking about the use of the SSH protocol being completely safe, this does not mean that it is oblivious to suffer some kind of attack that puts our information at risk. For this reason, users have the option to modify the default configuration of this protocol to make it even more secure, such as changing the default port or the maximum number of retries to connect to the server. Let's see how we can improve the security of our SSH.

First, we need to locate the configuration file, sshd_config. This file is usually in the /etc/ssh path.

The following configuration could be the default content of the file:

Port 22
Protocol 2
LoginGraceTime 30
PermitRootLogin no
MaxAuthTries 2
MaxStartups 3

These are the parameters we can modify in this file configuration: