Nowadays, many servers are getting hacked, through SSH. Many of the servers are vulnerable due to weak security. Lets see how you can secure your server through SSH.

1. Disable Root Login:
Accessing your server directly through root is okay but alternatively you can create another account in your server and login through that account. Using that user, you can su or sudo to access the root account. It makes the server more secure because generally the ‘root’ user is brute-forced.

2. Change SSH Port:

The default port ’22’ is a general target for hackers. You can change it to something else.

3. Use Public Keys instead of Passwords:

Public Keys are more secure than passwords as they are encrypted and you no longer have to enter the password and password-cracking or brute-forcing attempts won’t work!