This simple script allows the user to configure ssh settings like disabling the root user, changing the port number, termination when idle, disabling proto 1 and disabling password login while enabling keypair auth.
In addition to above, script allow the user to enable/disable host firewall, allow/deny ports. It also allows the user the set the ban policy for unwanted ssh login attempts. It can also show which ip got banned and when.
Primary reason for making this script is that everytime I create a VPS and want to harden my system a bit, I had to do this steps manually.
Hope this helps someone!
Get Started
wget https://raw.githubusercontent.com/v-filip/harden.sh/main/harden.sh && sudo chmod +x harden.sh && ./harden.sh
Tested and working on Debian, which means that it should work on most Debian based distros like Ubuntu for example.