Question
How to create jail in Fail2ban on Plesk server?
Answer
Please refer to Plesk Documentation for more information :
Fail2Ban Jails Management
Via CLI:
- Connect to the server via SSH
- Open
/etc/fail2ban/jail.local
in any text editor and add the following content with corresponding values:[Jail name]
enabled = {true/false}
filter = {specify the filter}
action = {specify the action}
logpath = {specify the log path}
bantime = {set IP address ban period}
maxretry = {Set the maximum number of failed login attempts}For example, to create MJ12bot jail:
[MJ12bot-jail]
enabled = true
filter = apache-badbots
action = iptables-multiport[name=MJ12bot, port="http,https,7080,7081"]
logpath = /var/www/vhosts/system/*/logs/*access*log
/var/log/httpd/*access_log
bantime = 600
maxretry = 3