Question
How to enable/disable Fail2Ban and its jails in Plesk?
Answer
-
Go to Tools & Settings > IP Address Banning (Fail2Ban) > switch to the Settings tab and check/uncheck Enable intrusion detection to enable/disable Fail2Ban.
-
Click Apply.
-
Switch to the Jails tab and enable/disable required jails using the Switch on/off buttons.
Note: Jails can be switched on only when Fail2Ban is enabled.
-
Connect to a Plesk server via SSH.
-
Activate/deactivate Fail2Ban:
-
Activating Fail2Ban:
# plesk bin ip_ban --enable
-
Deactivate Fail2Ban:
# plesk bin ip_ban --disable
-
-
List all available jails:
# plesk bin ip_ban --jails
-
Enable/disable a jail using its name from step 3 with the command:
Note: Jails can be activated only when Fail2Ban is enabled.
-
Enabling a jail:
# plesk bin ip_ban --enable-jails <jail_name>
In the example below, we are enabling the 'plesk-wordpress' jail:
# plesk bin ip_ban --enable-jails plesk-wordpress
-
Disabling a jail:
# plesk bin ip_ban --disable-jails plesk-wordpress
-