Fail2ban jailed configuration on Linux Server
- Log into Plesk and check its version. Since Plesk version 12.5 fail2ban is included by default. In case you have lower version you will have to upgrade Plesk before proceeding further. Once
- Click on Tools & Settings > IP Address Banning (Fail2Ban) > Settings.
- Select the checkbox for Enable intrusion detection and click on OK or Apply.
- Click on Jails tab
- Select the check boxes in front of the Jails you want to activate and click Switch On.
In case you do not have Plesk, you need first to log into your Linux server via ssh. Once you are there, depending on what linux distribution you have you need to use the specific application packet manager to install fail2ban. For example for RedHat and CentOS you can use:
yum install fail2ban
or for Ubuntu and Debian:
apt-get install fail2ban
Once it is installed, you need to edit the fail2ban main configuration file jail.conf with a text editor like vi ( which usually is located at /etc/fail2ban/jail.conf ). For example:
vi /etc/fail2ban/jail.conf
There are already pre-configured rules between “[ ]” directive that are disabled by enabled = false directive. In order to use some of those rules you just need to change the directive to true, save the file and restart fail2ban service. You can also add your own jails.