18 lines
762 B
Bash
18 lines
762 B
Bash
#!/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
|
|
|
|
|