Fail2ban: Difference between revisions
iwu |
mNo edit summary |
||
Line 23: | Line 23: | ||
Ban an IP from accessing any of the websites | Ban an IP from accessing any of the websites | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
$ sudo fail2ban-client set httpd banip 81.19.140.244 | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 11:13, 21 March 2024
Create a new jail named httpd
/etc/fail2ban/filter.d/httpd-ban.conf
:
[Definition]
failregex = ^<HOST> .*
ignoreregex =
/etc/fail2ban/jail.d/cutomisation.local
:
[httpd]
enabled = true
filter = httpd-ban
port = http,https
logpath = %(nginx_error_log)s
Ban an IP from accessing any of the websites
$ sudo fail2ban-client set httpd banip 81.19.140.244