2009-02-09 22:36:11 +00:00
__ _ _ ___ _
/ _|__ _(_ ) |_ ) |__ __ _ _ _
| _/ _ ` | | |/ /| '_ \/ _` | ' \
|_| \__,_|_|_/___|_.__/\__,_|_||_|
2023-06-16 14:59:22 +00:00
v1.1.0.dev1 20??/??/??
2004-10-12 21:45:41 +00:00
2013-05-03 03:55:26 +00:00
## Fail2Ban: ban hosts that cause multiple authentication errors
2004-10-12 21:45:41 +00:00
2017-11-10 22:56:10 +00:00
Fail2Ban scans log files like `/var/log/auth.log` and bans IP addresses conducting
2015-09-25 09:23:08 +00:00
too many failed login attempts. It does this by updating system firewall rules
to reject new connections from those IP addresses, for a configurable amount
of time. Fail2Ban comes out-of-the-box ready to read many standard log files,
2017-11-10 22:56:10 +00:00
such as those for sshd and Apache, and is easily configured to read any log
file of your choosing, for any error you wish.
2015-09-24 13:37:01 +00:00
2017-11-10 22:56:10 +00:00
Though Fail2Ban is able to reduce the rate of incorrect authentication
attempts, it cannot eliminate the risk presented by weak authentication.
Set up services to use only two factor, or public/private authentication
2014-02-02 04:17:10 +00:00
mechanisms if you really want to protect services.
2017-01-11 18:04:33 +00:00
2018-03-21 16:53:05 +00:00
< img src = "http://www.worldipv6launch.org/wp-content/themes/ipv6/downloads/World_IPv6_launch_logo.svg" height = "52pt" / > | Since v0.10 fail2ban supports the matching of IPv6 addresses.
2017-01-11 18:04:33 +00:00
------|------
2014-02-02 04:17:10 +00:00
2017-11-10 22:56:10 +00:00
This README is a quick introduction to Fail2Ban. More documentation, FAQ, and HOWTOs
2018-11-26 12:10:30 +00:00
to be found on fail2ban(1) manpage, [Wiki ](https://github.com/fail2ban/fail2ban/wiki ),
[Developers documentation ](https://fail2ban.readthedocs.io/ )
2018-04-03 09:43:58 +00:00
and the website: https://www.fail2ban.org
2004-10-12 21:45:41 +00:00
Installation:
-------------
2023-06-01 08:47:53 +00:00
Fail2Ban is likely already packaged for your Linux distribution and [can installed with a simple command ](https://github.com/fail2ban/fail2ban/wiki/How-to-install-fail2ban-packages ).
2023-05-31 22:13:48 +00:00
2023-06-01 08:47:53 +00:00
If your distribution is not listed, you can install from GitHub:
2013-04-25 04:07:39 +00:00
2006-09-14 22:05:32 +00:00
Required:
2023-06-16 14:24:32 +00:00
- [Python >= 3.5 ](https://www.python.org ) or [PyPy3 ](https://pypy.org )
- python-setuptools, python-distutils (or python3-setuptools) for installation from source
2006-09-14 22:05:32 +00:00
Optional:
2018-03-22 10:43:15 +00:00
- [pyinotify >= 0.8.3 ](https://github.com/seb-m/pyinotify ), may require:
* Linux >= 2.6.13
2018-02-06 16:02:23 +00:00
- [systemd >= 204 ](http://www.freedesktop.org/wiki/Software/systemd ) and python bindings:
2018-03-22 10:43:15 +00:00
* [python-systemd package ](https://www.freedesktop.org/software/systemd/python-systemd/index.html )
2015-01-24 17:22:34 +00:00
- [dnspython ](http://www.dnspython.org/ )
2004-10-12 21:45:41 +00:00
2018-03-22 10:43:15 +00:00
2017-11-10 22:56:10 +00:00
To install:
2004-10-12 21:45:41 +00:00
2023-02-28 10:36:34 +00:00
tar xvfj fail2ban-master.tar.bz2
cd fail2ban-master
2018-03-22 10:09:49 +00:00
sudo python setup.py install
2017-10-10 21:15:56 +00:00
2020-01-14 19:55:24 +00:00
Alternatively, you can clone the source from GitHub to a directory of Your choice, and do the install from there. Pick the correct branch, for example, master or 0.11
2004-10-12 21:45:41 +00:00
2018-03-22 10:09:49 +00:00
git clone https://github.com/fail2ban/fail2ban.git
2017-10-10 21:15:56 +00:00
cd fail2ban
sudo python setup.py install
2014-03-14 12:08:25 +00:00
This will install Fail2Ban into the python library directory. The executable
2017-11-10 22:56:10 +00:00
scripts are placed into `/usr/bin` , and configuration in `/etc/fail2ban` .
2005-04-24 11:04:29 +00:00
2006-11-19 21:36:32 +00:00
Fail2Ban should be correctly installed now. Just type:
2004-10-12 21:45:41 +00:00
2013-04-25 04:07:39 +00:00
fail2ban-client -h
2004-10-12 21:45:41 +00:00
2013-04-17 14:07:01 +00:00
to see if everything is alright. You should always use fail2ban-client and
never call fail2ban-server directly.
2017-10-10 21:15:56 +00:00
You can verify that you have the correct version installed with
2018-03-22 10:09:49 +00:00
fail2ban-client version
2004-10-12 21:45:41 +00:00
2015-09-24 13:37:01 +00:00
Please note that the system init/service script is not automatically installed.
To enable fail2ban as an automatic service, simply copy the script for your
2015-09-25 09:25:11 +00:00
distro from the `files` directory to `/etc/init.d` . Example (on a Debian-based
system):
2015-09-24 13:37:01 +00:00
cp files/debian-initd /etc/init.d/fail2ban
update-rc.d fail2ban defaults
service fail2ban start
2004-10-12 21:45:41 +00:00
Configuration:
--------------
2015-09-24 13:37:01 +00:00
You can configure Fail2Ban using the files in `/etc/fail2ban` . It is possible to
configure the server using commands sent to it by `fail2ban-client` . The
2013-04-17 14:07:01 +00:00
available commands are described in the fail2ban-client(1) manpage. Also see
2014-03-14 12:08:25 +00:00
fail2ban(1) and jail.conf(5) manpages for further references.
2006-08-22 22:20:09 +00:00
2013-04-25 04:07:39 +00:00
Code status:
------------
2023-04-24 21:10:47 +00:00
* [![CI ](https://github.com/fail2ban/fail2ban/actions/workflows/main.yml/badge.svg )](https://github.com/fail2ban/fail2ban/actions/workflows/main.yml)
2016-02-18 01:43:50 +00:00
2004-10-12 21:45:41 +00:00
Contact:
--------
2014-04-17 17:19:03 +00:00
### Bugs, feature requests, discussions?
See [CONTRIBUTING.md ](https://github.com/fail2ban/fail2ban/blob/master/CONTRIBUTING.md )
2011-11-29 02:39:41 +00:00
2013-04-25 04:07:39 +00:00
### You just appreciate this program:
2018-04-03 09:43:58 +00:00
Send kudos to the original author ([Cyril Jaquier](mailto:cyril.jaquier@fail2ban.org))
2014-04-17 17:19:03 +00:00
or *better* to the [mailing list ](https://lists.sourceforge.net/lists/listinfo/fail2ban-users )
2013-04-17 14:07:01 +00:00
since Fail2Ban is "community-driven" for years now.
2004-10-12 21:45:41 +00:00
Thanks:
-------
2013-04-25 04:07:39 +00:00
See [THANKS ](https://github.com/fail2ban/fail2ban/blob/master/THANKS ) file.
2004-10-12 21:45:41 +00:00
License:
--------
2009-02-09 22:36:11 +00:00
Fail2Ban is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
2004-10-12 21:45:41 +00:00
version.
2009-02-09 22:36:11 +00:00
Fail2Ban is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
2004-10-12 21:45:41 +00:00
2009-02-09 22:36:11 +00:00
You should have received a copy of the GNU General Public License along with
2013-03-10 04:18:09 +00:00
Fail2Ban; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110, USA