Articles in this section

How to create jail in Fail2ban on Plesk server?

kb: how-to Plesk for Linux ABT: Group A Ideal

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:
  1. Connect to the server via SSH
  2. 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

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.