fail2ban-client

intrusion prevention control interface

TLDR

Retrieve current status of a jail
$ fail2ban-client status [jail]
Remove IP from jail ban list
$ fail2ban-client set [jail] unbanip [ip_address]
Verify server is alive
$ fail2ban-client ping

SYNOPSIS

fail2ban-client command [arguments]

DESCRIPTION

fail2ban-client configures and controls the fail2ban server. Fail2ban monitors log files and bans IP addresses that show malicious behavior like repeated failed login attempts.Used for managing jail status, banning/unbanning IPs, and server control.

PARAMETERS

status [jail]

Show jail status
set jail action value
Configure jail settings
unbanip ip
Remove IP from ban list
ping
Check server is alive
start
Start the server
stop
Stop the server
reload
Reload configuration

CONFIGURATION

/etc/fail2ban/jail.conf

Default jail configurations (do not modify directly).
/etc/fail2ban/jail.local
Local overrides for jail configurations.
/etc/fail2ban/fail2ban.conf
Main fail2ban server configuration.
/etc/fail2ban/filter.d/
Filter definitions for log parsing.

INSTALL

sudo dnf install fail2ban
sudo pacman -S fail2ban
sudo apk add fail2ban
sudo zypper install fail2ban
brew install fail2ban
nix profile install nixpkgs#fail2ban

CAVEATS

Requires fail2ban-server to be running. Jail names are defined in configuration files. May require root privileges for most operations.

SEE ALSO

iptables(8)