This tutorial will show you on how to install Fail2Ban on your Ubuntu or CentOS VPS.
A Linux VPS
Fail2Ban is a popular program to protect the SSH protocol. Fail2Ban automatically update the iptables rule if failed login attempt reaches the defined threshold.
To install Fail2Ban in Ubuntu:
apt-get install fail2ban
and to install in CentOS:
yum install epel-release yum install fail2ban
SSHGuard and Fail2Ban should be sufficient to protect SSH login. However, if you need to explore more then, you may refer the following.