These commands manage Fail2Ban on Plesk for Linux through an SSH shell. They are not Windows Command Prompt commands and do not cover a standalone Fail2Ban installation without Plesk.

Before you start

Connect to the Plesk server using SSH with root access. Fail2Ban must be installed on the server. A jail defines the log monitoring and banning rules for a service; enabling Fail2Ban alone does not enable every jail.

Enable or disable Fail2Ban

Enable Fail2Ban:

plesk bin ip_ban --enable

To disable Fail2Ban, run:

plesk bin ip_ban --disable

Disabling it stops its intrusion-detection protection. Check the effect on the services you administer before changing the setting.

List available jails

Run:

plesk bin ip_ban --jails

Use a jail name from this output in the next commands. Available jails depend on the server’s installed services and configuration.

Enable a jail

Fail2Ban must be enabled before activating a jail. For a server that has the plesk-wordpress jail, run:

plesk bin ip_ban --enable-jails plesk-wordpress

Replace plesk-wordpress with the required jail name when managing a different jail.

Disable a jail

To disable that jail, run:

plesk bin ip_ban --disable-jails plesk-wordpress

Check the command output. You can also review jail settings in Plesk > Tools & Settings > IP Address Banning (Fail2Ban) > Jails.