Difference between revisions of "Fail2ban"

From Freephile Wiki
Jump to navigation Jump to search
(documenting weirdness)
(One intermediate revision by the same user not shown)
Line 36: Line 36:
 
# Values: TEXT
 
# Values: TEXT
 
#
 
#
failregex = ^<HOST> -.*�POST.*
+
failregex = ^<HOST> -.*.*
 
# Option: ignoreregex
 
# Option: ignoreregex
 
# Notes.: regex to ignore. If this regex matches, the line is ignored.
 
# Notes.: regex to ignore. If this regex matches, the line is ignored.
Line 56: Line 56:
 
  sudo fail2ban-client status
 
  sudo fail2ban-client status
 
  sudo fail2ban-client status apache-post
 
  sudo fail2ban-client status apache-post
 
== Status ==
 
If you have many jails, and want to see the status of each of them, there is no built-in <code>--all</code> option for '''<code>fail2ban-client status</code>''' but you can just use a simple short script:
 
<source lang="bash">
 
fail2ban-client status | sed -n 's/,//g;s/.*Jail list://p' | xargs -n1 fail2ban-client status
 
</source>
 
 
== Restarts ==
 
If you change a jail, or otherwise want to restart fail2ban, you can try the SystemD service manager: <code>systemctl reload fail2ban</code>. But, strangely that reports an error on freephile (because it's already running) and a <code>systemctl status fail2ban</code> says that it's FAILED.  Even <code>systemctl list-units</code> says it's failed. However, <code>ps axjf</code> shows it running and <code>/usr/bin/fail2ban-client ping</code> gets a 'pong' from the server. It looks like there are two installations (/usr/bin and /bin) but they both report the same thing (and the files are identical)
 
  
 
[[Category:Security]]
 
[[Category:Security]]

Revision as of 16:47, 27 October 2017