whatis fail2ban

Fail2ban

A daemon that watches logs for repeated failed logins and temporarily bans the offending IP addresses with firewall rules.

What Is Fail2ban in Linux?

Any server with SSH on the internet sees constant brute-force attempts. Fail2ban reads logs or the journal, matches failure patterns with "jails", and adds a firewall block after a threshold, such as five failures in ten minutes.

It reduces noise and load but is not a substitute for key-only SSH authentication. Jails exist for SSH, web servers, mail servers, and many apps.

Example

sudo fail2ban-client status sshd