How to manage fail2Ban and its jails through a CMD

August 27, 2024 / How-to Guide

In this guide, we have explained how to manage fail2Ban and its jails through a CMD. It offers more granular control and flexibility over configuration and troubleshooting.

Follow the steps:

  1. Join a Plesk server using SSH.
  2. To Activate/deactivate Fail2Ban:
    Activating Fail2Ban:
    # plesk bin ip_ban –enable
    Deactivating Fail2Ban:
    # plesk bin ip_ban –disable
  3. Show all accessible jails:
    # plesk bin ip_ban –jails
  4. Enable or disable a jail using its name from step 3 with the following command:
    Note: Jails can only be initiated when Fail2Ban is enabled.

    Enabling a jail:

    # plesk bin ip_ban –enable-jails <jail_name>
    The following example illustrates the activation of the ‘plesk-wordpress’ jail.
    # plesk bin ip_ban –enable-jails plesk-wordpress

    Disabling a jail:

    # plesk bin ip_ban –disable-jails plesk-wordpress

This way, you can manage Fail2Ban and its jails via the command line. We hope you found this article helpful.

For additional assistance, please contact our technical support team whenever needed.