fail2ban-client - configure and control the server
| Use Case | Command | Description |
|---|---|---|
| Start server and jails | fail2ban-client start | Starts the fail2ban server and all jails đ |
| Stop server | fail2ban-client stop | Stops all jails and terminates the server đ |
| Check server status | fail2ban-client status | Gets the current status of the server đ |
| Ban an IP | fail2ban-client set <JAIL> banip <IP> | Manually ban an IP address in a jail đĢ |
| Unban an IP | fail2ban-client set <JAIL> unbanip <IP> | Manually unban an IP address in a jail â |
| Unban all IPs | fail2ban-client unban --all | Unban all IP addresses in all jails đ |
| Get banned IPs | fail2ban-client get <JAIL> banned | List banned IPs for a jail đ |
| Reload configuration | fail2ban-client reload | Reloads configuration without restarting server đ |
| Test configuration | fail2ban-client -t | Test configuration for errors â |
fail2ban-client [OPTIONS] <COMMAND>
Fail2Ban v0.11.2 reads log file that contains password failure report and bans the corresponding IP addresses using firewall rules.
-c, --conf <DIR> â configuration directory đ
-s, --socket <FILE> â socket path đ
-p, --pidfile <FILE> â pidfile path đ
--pname <NAME> â name of the process (main thread) to identify instance (default fail2ban-server) đˇī¸
--loglevel <LEVEL> â logging level đ
--logtarget <TARGET> â logging target, use file-name or stdout, stderr, syslog or sysout đ¯
--syslogsocket auto|<FILE> â syslog socket path đ§
-d â dump configuration. For debugging đ
--dp, --dump-pretty â dump the configuration using more human readable representation đ¨ī¸
-t, --test â test configuration (can be also specified with start parameters) â
-v â increase verbosity đ
-q â decrease verbosity đ
-x â force execution of the server (remove socket file) âĄ
-b â start server in background (default) đ
-f â start server in foreground đĨī¸
--async â start server in async mode (for internal usage only, don't read configuration) âĄ
--timeout â timeout to wait for the server (for internal usage only, don't read configuration) âŗ
--str2sec <STRING> â convert time abbreviation format to seconds âąī¸
-h, --help â display this help message â
-V, --version â print the version (-V returns machine-readable short format) âšī¸
start â starts the server and the jails đ
restart â restarts the server đ
restart [--unban] [--if-exists] <JAIL> â restarts the jail <JAIL> (alias for 'reload --restart ... <JAIL>') đ
reload [--restart] [--unban] [--all] â reloads the configuration without restarting of the server, the option '--restart' activates completely restarting of affected jails, thereby can unban IP addresses (if option '--unban' specified) đ
reload [--restart] [--unban] [--if-exists] <JAIL> â reloads the jail <JAIL>, or restarts it (if option '--restart' specified) đ
stop â stops all jails and terminate the server đ
unban --all â unbans all IP addresses (in all jails and database) đ
unban <IP> ... <IP> â unbans <IP> (in all jails and database) đ
banned â return jails with banned IPs as dictionary đĢ
banned <IP> ... <IP>] â return list(s) of jails where given IP(s) are banned đĢ
status â gets the current status of the server đ
ping â tests if the server is alive đ
echo â for internal usage, returns back and outputs a given string đ
help â return this output â
version â return the server version âšī¸
set loglevel <LEVEL> â sets logging level to <LEVEL>. Levels: CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG, TRACEDEBUG, HEAVYDEBUG or corresponding numeric value (50-5) đ
get loglevel â gets the logging level đ
set logtarget <TARGET> â sets logging target to <TARGET>. Can be STDOUT, STDERR, SYSLOG or a file đ¯
get logtarget â gets logging target đ¯
set syslogsocket auto|<SOCKET> â sets the syslog socket path to auto or <SOCKET>. Only used if logtarget is SYSLOG đ§
get syslogsocket â gets syslog socket path đ§
flushlogs â flushes the logtarget if a file and reopens it. For log rotation. đ
set dbfile <FILE> â set the location of fail2ban persistent datastore. Set to "None" to disable đž
get dbfile â get the location of fail2ban persistent datastore đž
set dbmaxmatches <INT> â sets the max number of matches stored in database per ticket đĸ
get dbmaxmatches â gets the max number of matches stored in database per ticket đĸ
set dbpurgeage <SECONDS> â sets the max age in <SECONDS> that history of bans will be kept âŗ
get dbpurgeage â gets the max age in seconds that history of bans will be kept âŗ
add <JAIL> <BACKEND> â creates <JAIL> using <BACKEND> â
start <JAIL> â starts the jail <JAIL> đ
stop <JAIL> â stops the jail <JAIL>. The jail is removed đ
status <JAIL> [FLAVOR] â gets the current status of <JAIL>, with optional flavor or extended info đ
set <JAIL> idle on|off â sets the idle state of <JAIL> đ¤
set <JAIL> ignoreself true|false â allows the ignoring of own IP addresses đ
set <JAIL> addignoreip <IP> â adds <IP> to the ignore list of <JAIL> â
set <JAIL> delignoreip <IP> â removes <IP> from the ignore list of <JAIL> â
set <JAIL> ignorecommand <VALUE> â sets ignorecommand of <JAIL> đ ī¸
set <JAIL> ignorecache <VALUE> â sets ignorecache of <JAIL> đī¸
set <JAIL> addlogpath <FILE> ['tail'] â adds <FILE> to the monitoring list of <JAIL>, optionally starting at the 'tail' of the file (default 'head') đ
set <JAIL> dellogpath <FILE> â removes <FILE> from the monitoring list of <JAIL> â
set <JAIL> logencoding <ENCODING> â sets the <ENCODING> of the log files for <JAIL> đ¤
set <JAIL> addjournalmatch <MATCH> â adds <MATCH> to the journal filter of <JAIL> đ°
set <JAIL> deljournalmatch <MATCH> â removes <MATCH> from the journal filter of <JAIL> â
set <JAIL> addfailregex <REGEX> â adds the regular expression <REGEX> which must match failures for <JAIL> đ
set <JAIL> delfailregex <INDEX> â removes the regular expression at <INDEX> for failregex â
set <JAIL> addignoreregex <REGEX> â adds the regular expression <REGEX> which should match pattern to exclude for <JAIL> đĢ
set <JAIL> delignoreregex <INDEX> â removes the regular expression at <INDEX> for ignoreregex â
set <JAIL> findtime <TIME> â sets the number of seconds <TIME> for which the filter will look back for <JAIL> â˛ī¸
set <JAIL> bantime <TIME> â sets the number of seconds <TIME> a host will be banned for <JAIL> âŗ
set <JAIL> datepattern <PATTERN> â sets the <PATTERN> used to match date/times for <JAIL> đ
set <JAIL> usedns <VALUE> â sets the usedns mode for <JAIL> đ
set <JAIL> attempt <IP> [<failure1> ... <failureN>] â manually notify about <IP> failure â ī¸
set <JAIL> banip <IP> ... <IP> â manually Ban <IP> for <JAIL> đĢ
set <JAIL> unbanip [--report-absent] <IP> ... <IP> â manually Unban <IP> in <JAIL> â
set <JAIL> maxretry <RETRY> â sets the number of failures <RETRY> before banning the host for <JAIL> đ
set <JAIL> maxmatches <INT> â sets the max number of matches stored in memory per ticket in <JAIL> đĸ
set <JAIL> maxlines <LINES> â sets the number of <LINES> to buffer for regex search for <JAIL> đ
set <JAIL> addaction <ACT>[ <PYTHONFILE> <JSONKWARGS>] â adds a new action named <ACT> for <JAIL>. Optionally for a Python based action, a <PYTHONFILE> and <JSONKWARGS> can be specified, else will be a Command Action â
set <JAIL> delaction <ACT> â removes the action <ACT> from <JAIL> â
set <JAIL> action <ACT> actionstart <CMD> â sets the start command <CMD> of the action <ACT> for <JAIL> âļī¸
set <JAIL> action <ACT> actionstop <CMD> â sets the stop command <CMD> of the action <ACT> for <JAIL> âšī¸
set <JAIL> action <ACT> actioncheck <CMD> â sets the check command <CMD> of the action <ACT> for <JAIL> âī¸
set <JAIL> action <ACT> actionban <CMD> â sets the ban command <CMD> of the action <ACT> for <JAIL> đĢ
set <JAIL> action <ACT> actionunban <CMD> â sets the unban command <CMD> of the action <ACT> for <JAIL> â
set <JAIL> action <ACT> timeout <TIMEOUT> â sets <TIMEOUT> as the command timeout in seconds for the action <ACT> for <JAIL> âąī¸
set <JAIL> action <ACT> <PROPERTY> <VALUE> â sets the <VALUE> of <PROPERTY> for the action <ACT> for <JAIL> đ ī¸
set <JAIL> action <ACT> <METHOD>[ <JSONKWARGS>] â calls the <METHOD> with <JSONKWARGS> for the action <ACT> for <JAIL> đ
get <JAIL> banned â return banned IPs of <JAIL> đĢ
get <JAIL> banned <IP> ... <IP>] â return 1 if IP is banned in <JAIL> otherwise 0, or a list of 1/0 for multiple IPs đĢ
get <JAIL> logpath â gets the list of the monitored files for <JAIL> đ
get <JAIL> logencoding â gets the encoding of the log files for <JAIL> đ¤
get <JAIL> journalmatch â gets the journal filter match for <JAIL> đ°
get <JAIL> ignoreself â gets the current value of the ignoring the own IP addresses đ
get <JAIL> ignoreip â gets the list of ignored IP addresses for <JAIL> đ
get <JAIL> ignorecommand â gets ignorecommand of <JAIL> đ ī¸
get <JAIL> failregex â gets the list of regular expressions which matches the failures for <JAIL> đ
get <JAIL> ignoreregex â gets the list of regular expressions which matches patterns to ignore for <JAIL> đĢ
get <JAIL> findtime â gets the time for which the filter will look back for failures for <JAIL> â˛ī¸
get <JAIL> bantime â gets the time a host is banned for <JAIL> âŗ
get <JAIL> datepattern â gets the pattern used to match date/times for <JAIL> đ
get <JAIL> usedns â gets the usedns setting for <JAIL> đ
get <JAIL> banip [<SEP>|--with-time] â gets the list of of banned IP addresses for <JAIL>. Optionally the separator character ('<SEP>', default is space) or the option '--with-time' (printing the times of ban) may be specified. The IPs are ordered by end of ban. đĢ
get <JAIL> maxretry â gets the number of failures allowed for <JAIL> đ
get <JAIL> maxmatches â gets the max number of matches stored in memory per ticket in <JAIL> đĸ
get <JAIL> maxlines â gets the number of lines to buffer for <JAIL> đ
get <JAIL> actions â gets a list of actions for <JAIL> âĄ
get <JAIL> action <ACT> actionstart â gets the start command for the action <ACT> for <JAIL> âļī¸
get <JAIL> action <ACT> actionstop â gets the stop command for the action <ACT> for <JAIL> âšī¸
get <JAIL> action <ACT> actioncheck â gets the check command for the action <ACT> for <JAIL> âī¸
get <JAIL> action <ACT> actionban â gets the ban command for the action <ACT> for <JAIL> đĢ
get <JAIL> action <ACT> actionunban â gets the unban command for the action <ACT> for <JAIL> â
get <JAIL> action <ACT> timeout â gets the command timeout in seconds for the action <ACT> for <JAIL> âąī¸
get <JAIL> actionproperties <ACT> â gets a list of properties for the action <ACT> for <JAIL> đ
get <JAIL> actionmethods <ACT> â gets a list of methods for the action <ACT> for <JAIL> đ§
get <JAIL> action <ACT> <PROPERTY> â gets the value of <PROPERTY> for the action <ACT> for <JAIL> đ ī¸
/etc/fail2ban/*
Report bugs via Debian bug tracking system http://www.debian.org/Bugs/ .
Generated by phpman v4.9.29 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-21 07:12 @2600:1f28:365:80b0:e9a9:ac35:f5fe:ea62
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format