Last Updated on October 17, 2023
Fail2Ban is a daemon to ban hosts that cause multiple authentication errors. The software scans log files like /var/log/pwdfail pwdfail and bans IP addresses that make too many password failures.
It updates firewall rules to reject the IP address. These rules can be defined by the user.
Fail2Ban can read multiple log files such as sshd or Apache Web server ones. Fail2Ban comes out-of-the-box ready to read many standard log files, such as those for sshd and Apache, and is easily configured to read any log file of your choosing, for any error you wish.
Features include:
- Python based actions.
- Database support.
- Multi-line parsing in filters.
- Custom date time support for filters.
- Timezone awareness by default.
- Timeout on ban commands.
- Character set awareness in log files.
- Python3+ support.
- Client/Server architecture.
- Multi-threaded.
- Highly configurable using split configuration files
- Gamin/Pyinotify support.
- Parses log files and look for given patterns.
- Executes command(s) when a pattern has been detected for the same IP address for more than X times to ban that address. X can be changed.
- After a given amount of time, execute another command in order to unban the IP address.
- Uses Netfilter/Iptables by default but can also use TCP Wrapper (/etc/hosts.deny) and many other firewalls/actions.
- Handles log files rotation.
- Can handle multiple services at once (sshd, apache, vsftpd, etc).
- Resolves DNS hostname to IP address (use with caution, disable by usedns = no).
Website: github.com/fail2ban/fail2ban
Support:
Developer: Cyril Jaquier, Yaroslav Halchenko, Daniel Black, Steven Hiscocks, Arturo ‘Buanzo’ Busleiman, and others
License: GNU General Public License v2.0
Fail2Ban is written in Python. Learn Python with our recommended free books and free tutorials.
Return to Intrusion Prevention Software
| Explore Linux | |
|---|---|
| Best Free and Open Source Software - A huge collection of recommended free and open source software covering every major category. | |
| In-depth Linux Software Reviews - Detailed assessments of Linux software covering features, usability and overall quality. | |
| The Big List of Active Linux Distros - An extensive collection of actively developed Linux distributions. | |
| Open Source Alternatives - Alternatives to software and services from Google, Microsoft, Apple, Adobe, IBM, Autodesk, Oracle and others. | |
| Essential Linux System Tools - Indispensable utilities for monitoring, maintaining and managing Linux systems. | |
| Linux Productivity Tools - Useful utilities for improving productivity and streamlining everyday tasks. | |
| Alternatives to Popular CLI Tools - Modern alternatives to familiar command-line utilities supplied with Linux systems. | |
| Awesome Free Linux Game Tools - Tools, utilities and companion software that improve gaming on Linux. | |
| Machine Learning on Linux - Machine learning and deep learning software, self-hosted applications and practical tools. | |
| Saving Money with Linux - Practical ways to reduce electricity consumption and lower computing costs with Linux. | |
| Linux Candy - Fun, entertaining and sometimes delightfully quirky software from the lighter side of Linux. | |

Please read our Comment Policy before commenting.