FAIL2BAN-PYTHON(1)

๐ŸŒธ NAME ๐ŸŒธ

fail2ban-python โ€” a helper for Fail2Ban to assure that the same Python is used ๐Ÿ’…

ok so picture this: Fail2Ban just needs everybody on the same Python, and this lil cutie is the one who makes sure that happens. that's the whole vibe. bestie behavior honestly ๐Ÿซถ


โœจ DESCRIPTION โœจ

here's how you call it, no cap:

fail2ban-python [option] ... [-c cmd | -m mod | file | -] [arg] ...

and yes, there are options โ€” and they come with corresponding environment variables</> too, iykyk. every single one, incoming ๐Ÿ‘‡

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -b โ€” issue warnings about converting bytes/bytearray to str and comparing bytes/bytearray with str or bytes with int. and if you go -bb (yes, double) it issues errors instead of warnings. escalate bestie ๐Ÿ’€
  • -B โ€” don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x
  • -c cmd โ€” program passed in as string. heads up: this terminates the option list. periodt.
  • -d โ€” turn on parser debugging output. and listen, this one's for experts only, and it only works on debug builds. you've been warned ๐Ÿ™ˆ; also PYTHONDEBUG=x
  • -E โ€” ignore PYTHON* environment variables (such as PYTHONPATH). like, all of 'em. not the vibe today โœ‹
  • -h โ€” print this help message and exit (also -? or --help). classic icon behavior ๐Ÿ‘‘
  • -i โ€” inspect interactively after running script; forces a prompt even if stdin does not appear to be a terminal; also PYTHONINSPECT=x
  • -I โ€” isolate Python from the user's environment (implies -E, -P and -s). it's giving main character energy, alone in its own little world ๐Ÿฆ‹
  • -m mod โ€” run library module as a script. also terminates the option list, so mind where you put it.
  • -O โ€” remove assert and __debug__-dependent statements; add .opt-1 before .pyc extension; also PYTHONOPTIMIZE=x
  • -OO โ€” do -O changes and also discard docstrings; add .opt-2 before .pyc extension. double optimized, double slay โœจ
  • -P โ€” don't prepend a potentially unsafe path to sys.path; also PYTHONSAFEPATH. safety first bestie ๐ŸŽ€
  • -q โ€” don't print version and copyright messages on interactive startup. shy girl era ๐ŸŒธ
  • -s โ€” don't add user site directory to sys.path; also PYTHONNOUSERSITE=x
  • -S โ€” don't imply 'import site' on initialization
  • -u โ€” force the stdout and stderr streams to be unbuffered; this option has no effect on stdin; also PYTHONUNBUFFERED=x
  • -v โ€” verbose (trace import statements); also PYTHONVERBOSE=x. and get this โ€” it can be supplied multiple times to increase verbosity, so you can just keep stacking it, no cap ๐Ÿ”ฅ
  • -V โ€” print the Python version number and exit (also --version). when given twice, print more information about the build ๐Ÿ‘€
  • -W arg โ€” warning control; arg is action:message:category:module:lineno; also PYTHONWARNINGS=arg
  • -x โ€” skip first line of source, allowing use of non-Unix forms of #!cmd
  • -X opt โ€” set implementation-specific option
  • --check-hash-based-pycs always|default|never โ€” control how Python invalidates hash-based .pyc files. pick one of those three values, don't freestyle ๐Ÿซถ
  • --help-env โ€” print help about Python environment variables and exit
  • --help-xoptions โ€” print help about implementation-specific -X options and exit
  • --help-all โ€” print complete help information and exit. the full lore drop ๐Ÿ“š

๐Ÿงš ARGUMENTS ๐Ÿงš

  • file โ€” program read from script file
  • - โ€” program read from stdin (default; interactive mode if a tty)
  • arg ... โ€” arguments passed to program in sys.argv[1:]
ok tiny reminder bestie: -c cmd and -m mod both terminate the option list, so anything after them is not an option anymore. plan accordingly ๐Ÿ’œ

๐Ÿ”ฎ SEE ALSO ๐Ÿ”ฎ

fail2ban-client(1) โ€” go give her a read too, she's iconic ๐Ÿ‘‘


and that's the whole page, bestie ๐ŸŽ€ fail2ban-python 1.1.1, dated August 2026 โ€” mwah, go forth and Python responsibly ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from