FAIL2BAN-CLIENT(1)
๐ FAIL2BAN-CLIENT(1) ๐
hii bestie!! you've landed on the FAIL2BAN-CLIENT(1) page โ it lives in the User Commands section of the manual, and honestly? iconic placement. this is the lil client that lets you talk to your fail2ban server: configure it, poke it, control it. no cap, it's giving main character energy already ๐ฆ
โจ NAME โจ
fail2ban-client โ configure and control the server.
that's it. that's the whole job description. she configures, she controls, she slays ๐
๐ SYNOPSIS ๐
fail2ban-client [OPTIONS] <COMMAND>
๐ธ DESCRIPTION ๐ธ
Fail2Ban v1.1.1 reads log file that contains password failure report and bans the corresponding IP addresses using firewall rules.
okay so in human words: she reads the log file that's full of password failure reports ๐ญ and then bans the matching IP addresses using firewall rules, like a bouncer with a clipboard and zero chill. fr fr ๐ฅ
๐ OPTIONS ๐
grab a snack, there's a whole list ๐
-c,--conf<DIR>โ configuration directory. basically "bestie, the configs live HERE" ๐๏ธ-s,--socket<FILE>โ socket path. the lil doorway she talks through ๐-p,--pidfile<FILE>โ pidfile path. where she leaves her pid receipt ๐งพ--pname<NAME>โ name of the process (main thread) to identify instance, default isfail2ban-server. so you can be like "that one, yeah her" ๐--loglevel<LEVEL>โ logging level. how chatty she's feeling โจ--logtarget<TARGET>โ logging target, use file-name orstdout,stderr,syslogorsysout. pick her outfit, I mean her output ๐--syslogsocketโauto|<FILE>. yes that's the whole thing.-dโ dump configuration. for debugging ๐--dp,--dump-prettyโ dump the configuration using more human readable representation. a pretty dump, we love a glow-up โจ-t,--testโ test configuration (can be also specified with start parameters). vibe check your config before she commits, love that for us ๐ซถ-iโ interactive mode. she wants engagement ๐ฌ-vโ increase verbosity. more words, more tea โ-qโ decrease verbosity. shhh era ๐คซ-xโ force execution of the server (remove socket file). she's not asking, she's telling ๐-bโ start server in background (default). lurking, respectfully ๐-fโ start server in foreground. front and center, main character style ๐--asyncโ start server in async mode. for internal usage only, don't read configuration โ ๏ธ like for real, this one's not for you--timeoutโ timeout to wait for the server. for internal usage only, don't read configuration โ ๏ธ same energy, hands off bestie--str2sec<STRING>โ convert time abbreviation format to seconds. math but make it cute ๐งฎ-h,--helpโ display this help message. the classic "help me help you" ๐-V,--versionโ print the version (-Vreturns machine-readable short format). short and machine-readable, she's efficient like that ๐
okay that's the options handled โ but this page is not done with us yet, keep scrolling bestie ๐
โจ COMMAND โจ
okay bestie, this is the good part โ every single thing you can actually do with fail2ban-client. Buckle in, there's like a million of them and they're all iconic in their own way ๐
๐ธ BASIC ๐ธ
startโ starts the server and the jails. the whole engine, up and running ๐restartโ restarts the server. classic off-and-on-again energy.restart [--unban] [--if-exists] <JAIL>โ restarts the jail<JAIL>. it's literally just an alias forreload --restart ... <JAIL>, no cap ๐ซถreload [--restart] [--unban] [--all]โ reloads the config but doesn't restart the server itself. add--restartand the affected jails fully restart too, which can unban IP addresses (only if you also pass--unban, iykyk).reload [--restart] [--unban] [--if-exists] <JAIL>โ reloads just<JAIL>, or restarts it if you threw in--restart.stopโ stops all the jails and terminates the server. it's giving "closing time at the mall" ๐ญunban --allโ unbans every single IP address, in all jails and the database. mass forgiveness era ๐unban <IP> ... <IP>โ unbans the<IP>(s) you name, across all jails and the database.bannedโ returns the jails that have banned IPs, as a dictionary.banned <IP> ... <IP>]โ returns the list(s) of jails where the given IP(s) are banned.statusโ gets the current status of the server. the vibe check of the whole operation.status --all [FLAVOR]โ gets the status of all the jails, with an optional output style[FLAVOR]. the flavors are:'basic'(default),'cymru','short','stats'โจstat[istic]sโ gets the current statistics of all jails as a table. numbers girlies rise ๐pingโ tests if the server is alive. are you there bestie?? ๐echoโ for internal usage; returns back and outputs a given string.versionโ returns the server version. slay, what era are we in ๐
๐ LOGGING ๐
set loglevel <LEVEL>โ sets the logging level to<LEVEL>. the levels are:CRITICAL,ERROR,WARNING,NOTICE,INFO,DEBUG,TRACEDEBUG,HEAVYDEBUG, or the corresponding numeric value (50-5).get loglevelโ gets the logging level.set logtarget <TARGET>โ sets the logging target to<TARGET>. can beSTDOUT,STDERR,SYSLOG,SYSTEMD-JOURNAL, or a file.get logtargetโ gets the logging target.set syslogsocket auto|<SOCKET>โ sets the syslog socket path toautoor<SOCKET>. heads up: this is only used if logtarget isSYSLOG๐ซถget syslogsocketโ gets the syslog socket path.flushlogsโ flushes the logtarget if it's a file and reopens it. for log rotation, periodt.
๐ฆ DATABASE ๐ฆ
set dbfile <FILE>โ sets the location of the fail2ban persistent datastore. set it to"None"to disable it entirely.get dbfileโ gets the location of the fail2ban persistent datastore.set dbmaxmatches <INT>โ sets the max number of matches stored in the database per ticket.get dbmaxmatchesโ gets the max number of matches stored in the database per ticket.set dbpurgeage <SECONDS>โ sets the max age, in<SECONDS>, that the history of bans will be kept.get dbpurgeageโ gets the max age in seconds that the history of bans will be kept.
๐ JAIL CONTROL ๐
add <JAIL> <BACKEND>โ creates<JAIL>using<BACKEND>.start <JAIL>โ starts the jail<JAIL>.stop <JAIL>โ stops the jail<JAIL>. ngl, the jail is removed.status <JAIL> [FLAVOR]โ gets the current status of<JAIL>, with an optional output style[FLAVOR]. flavors:'basic'(default),'cymru','short','stats'.
๐ JAIL CONFIGURATION ๐
set <JAIL> idle on|offโ sets the idle state of<JAIL>.set <JAIL> ignoreself true|falseโ allows the ignoring of your 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>โ setsignorecommandof<JAIL>.set <JAIL> ignorecache <VALUE>โ setsignorecacheof<JAIL>.set <JAIL> addlogpath <FILE> ['tail']โ adds<FILE>to the monitoring list of<JAIL>, optionally starting at the'tail'of the file (default is'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>forfailregex.set <JAIL> addignoreregex <REGEX>โ adds the regular expression<REGEX>, which should match patterns to exclude for<JAIL>.set <JAIL> delignoreregex <INDEX>โ removes the regular expression at<INDEX>forignoreregex.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 theusednsmode for<JAIL>.set <JAIL> attempt <IP> [<failure1> ... <failureN>]โ manually notify about<IP>failure.set <JAIL> banip <IP> ... <IP>โ manually Ban<IP>for<JAIL>. you're the bouncer now ๐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, you can specify a<PYTHONFILE>and<JSONKWARGS>; otherwise it'll be a Command Action.set <JAIL> delaction <ACT>โ removes the action<ACT>from<JAIL>.
๐ COMMAND ACTION CONFIGURATION ๐
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>.
๐ง GENERAL ACTION CONFIGURATION ๐ง
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>.
๐ฆ JAIL INFORMATION ๐ฆ
get <JAIL> bannedโ returns the banned IPs of<JAIL>.get <JAIL> banned <IP> ... <IP>]โ returns1if the IP is banned in<JAIL>, otherwise0; or a list of1/0for 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 of your own IP addresses.get <JAIL> ignoreipโ gets the list of ignored IP addresses for<JAIL>.get <JAIL> ignorecommandโ getsignorecommandof<JAIL>.get <JAIL> failregexโ gets the list of regular expressions which match the failures for<JAIL>.get <JAIL> ignoreregexโ gets the list of regular expressions which match 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 theusednssetting for<JAIL>.get <JAIL> banip [<SEP>|--with-time]โ gets the list of banned IP addresses for<JAIL>. optionally you can pass the separator character ('<SEP>', default is space) or the option'--with-time'(which prints the times of ban). 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>.
๐ COMMAND ACTION INFORMATION ๐
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>.
๐ GENERAL ACTION INFORMATION ๐
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>.
๐ FILES ๐
/etc/fail2ban/*
that's the whole config neighborhood, bestie ๐ก
๐ REPORTING BUGS ๐
found a bug? don't gatekeep it โ report it to https://github.com/fail2ban/fail2ban/issues ๐ซถ
๐ธ SEE ALSO ๐ธ
okay that's the whole thing, you're officially a fail2ban-client expert now, no cap ๐ this gorgeous specimen of a manual page came from Fail2Ban v1.1.1, dated August 2026, and it's the FAIL2BAN-CLIENT(1) page โ go forth and ban responsibly, mwah ๐๐โจ
๐ฆ where this page comes from
- arch rolling: fail2ban 1.1.1-1 ยท GPL-2.0-or-later
- nixpkgs unstable: fail2ban 1.1.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms