Add 'config/Fail2Ban/setup-fail2banWP.sh'
This commit is contained in:
17
config/Fail2Ban/setup-fail2banWP.sh
Normal file
17
config/Fail2Ban/setup-fail2banWP.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
echo 'Make sure to install the "WP fail2ban" plugin'
|
||||
|
||||
#Applying the filter to Fail2Ban
|
||||
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/Fail2Ban/filter.d/wordpress-hard.conf -O /etc/fail2ban/filter.d/wordpress-hard.conf
|
||||
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/Fail2Ban/jail.d/wordpress-jail.conf -O /etc/fail2ban/jail.d/wordpress-jail.conf
|
||||
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/Fail2Ban/logrotate.d/fail2b -O /etc/logrotate.d/fail2b
|
||||
|
||||
sysip=$(curl ipecho.net/plain ; echo)
|
||||
echo "ignoreip = 127.0.0.1/8 $sysip" >> /etc/fail2ban/jail.local
|
||||
|
||||
sudo service fail2ban restart
|
||||
|
||||
##Test the filter
|
||||
#sudo fail2ban-client status wordpress-hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user