One thing, that usually come first when you setup a Virtual Private Server (VPS) is security and enabling ssh exposes you to some hack activity! Yep, internet can be a wild and scary place sometimes!

Internet can be a wild and scary place sometimes!

An email alert, when someone logs in to your server via ssh, can be pretty useful to track who is actually using your server! But Keep in mind that this trick is not enough to secure your server! And here you are more useful basic advices before seeing how to set up our SSH alert:

Layered security is the key!

Disable SSH login for root user

Change your default ssh port (22) , it can lead to a drop by the 98% of attacks’ chance, as Recon Bots look for IP addresses with open default ports for some services like ssh;

, it can lead to a drop by the 98% of attacks’ chance, as Recon Bots look for IP addresses with open default ports for some services like ssh; Use fail2ban to prevent brute-force attacks on your new ssh port, it provides an automated way to identify a possible break-in and acts upon them quickly with a pitiless ban!

it provides an automated way to identify a possible break-in and acts upon them quickly with a pitiless ban! If you want to increase your security with password access over ssh use port knocking or 2FA otherwise switch to SSH key.

Now let’s go back to the main topic, the article will be divided into 2 part: