Plesk for Linux
kb: how-to
ABT: Group A
Applicable to:
- Plesk for Linux
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:
CONFIG_TEXT: [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:
CONFIG_TEXT: [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
Comments
4 comments
hello
Fail2ban it gives an error
Unable to open selected jails: f2bmng failed: ERROR:__main__:[Errno 21] Is a directory: '/etc/fail2ban/jail.local'.
@Tufan Lbs
Hi! Try cleaning duplicate system packages:
# yum install yum-utils
# package-cleanup --cleandupes
In case the issue persists, please submit a request to Plesk Support.
Seçilen jail'ler açılamıyor: f2bmng failed: ERROR:__main__:[Errno 21] Is a directory: '/etc/fail2ban/jail.local'.
The problem is not solved giving the same error
@Tufan Lbs please create a ticket to our support department https://support.plesk.com/hc/en-us/requests/new
Please sign in to leave a comment.