23.3 Fail2Ban
SSH is an inherent security risk in that a suitably persistent attacker can sooner or later guess a valid login password through endless trial and error. Hackers can use automated password cracking tools such as hydra, ncrack, or medusa to do this.
Fortunately, it’s relatively easy to prevent such attacks by simply blocking a particular host for a while after several unsuccessful attempts. This is exactly what the Fail2Ban program does. It can monitor various other network services besides SSH. The attacking computer is blocked by firewall rules.
DenyHosts
In the past, the simpler DenyHosts program was often used instead of Fail2Ban. However, it is no longer maintained and is no longer available in the package sources of many ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access