yum install fail2ban iptables-services -y
systemctl start fail2ban iptables
systemctl enable fail2ban iptables
curl https://repo.bkatz.net/iptables > /etc/sysconfig/iptables
wget -O /etc/fail2ban/jail.d/wordpress-jail.conf https://repo.bkatz.net//wordpress-jail.conf
wget -O /etc/fail2ban/filter.d/wordpress-hard.conf https://repo.bkatz.net//wordpress-hard.conf
touch /var/log/auth.log
echo "auth,authpriv.* /var/log/auth.log" >> /etc/rsyslog.conf
systemctl restart iptables fail2ban rsyslog
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
cd /var/www/html && /usr/local/bin/wp --allow-root plugin install wp-fail2ban
cd /var/www/html && /usr/local/bin/wp --allow-root plugin activate wp-fail2ban
fail2ban-client status
fail2ban-client status wordpress-hard
for unban ip
fail2ban-client set wordpress-hard unbanip {ipaddress}