forked from Sophia/thelinuxlist
Added Fail2Ban script
This commit is contained in:
parent
4e8772e286
commit
996707c717
|
@ -64,7 +64,12 @@
|
||||||
|
|
||||||
## Wordpress
|
## Wordpress
|
||||||
### ✔️ Install
|
### ✔️ Install
|
||||||
### `wget -O wpinstall.sh https://sop.wtf/wpinstall && bash wpinstall.sh`
|
### `wget -O wpinstall.sh https://sop.wtf/sh/wpinstall && bash wpinstall.sh`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Fail2Ban
|
||||||
|
### ✔️ Install
|
||||||
|
### `wget -O wpinstall.sh https://sop.wtf/sh/fail2baninstall && bash fail2baninstall.sh`
|
||||||
|
|
||||||
|
---
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -r -p "Would you like to install fail2ban? [Y/n] " input
|
||||||
|
|
||||||
|
case $input in
|
||||||
|
[yY][eE][sS]|[yY])
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
[nN][oO]|[nN])
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "That wasn't an option..."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
sudo apt update && sudo apt upgrade -y
|
||||||
|
sudo apt install fail2ban -y
|
||||||
|
sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local
|
||||||
|
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
|
||||||
|
sudo systemctl enable fail2ban
|
||||||
|
|
||||||
|
echo -e "=================================================================="
|
||||||
|
|
||||||
|
echo "Fail2Ban has been installed!"
|
||||||
|
echo "The F2B Config can be found at /etc/fail2ban/fail2ban.local"
|
||||||
|
echo "The F2B Jails Config can be found at /etc/fail2ban/jail.local"
|
||||||
|
echo "When it has been setup to your liking you can run ~fail2ban-client start~"
|
||||||
|
|
||||||
|
echo -e "=================================================================="
|
Loading…
Reference in New Issue