Added Fail2Ban
This commit is contained in:
13
setup.sh
13
setup.sh
@@ -2,8 +2,8 @@ mrepo=https://git.ictmaatwerk.com/VPS-scripts/UBU-Backup-SRV
|
|||||||
mbranch=master
|
mbranch=master
|
||||||
|
|
||||||
#install needed packages
|
#install needed packages
|
||||||
apt install rssh vsftpd openssh-server git -y
|
apt install rssh vsftpd openssh-server git fail2ban -y
|
||||||
apt-get install --no-install-recommends eiciel
|
apt-get install --no-install-recommends eiciel xorg -y
|
||||||
#Setup groups
|
#Setup groups
|
||||||
groupadd sftpusers
|
groupadd sftpusers
|
||||||
groupadd ftpusers
|
groupadd ftpusers
|
||||||
@@ -57,6 +57,11 @@ ufw allow 30000:31000/tcp
|
|||||||
ufw limit 22/tcp
|
ufw limit 22/tcp
|
||||||
echo "y" | ufw enable
|
echo "y" | ufw enable
|
||||||
|
|
||||||
|
#F2B Config
|
||||||
|
wget -q -t7 "$mrepo"/raw/branch/"$mbranch"/config/fail2ban/jail.local -O /etc/fail2ban/jail.local
|
||||||
|
wget -q -t7 "$mrepo"/raw/branch/"$mbranch"/config/fail2ban/jail-vsftp.local -O /etc/fail2ban/jail.d/vsftp.local
|
||||||
|
wget -q -t7 "$mrepo"/raw/branch/"$mbranch"/config/fail2ban/filter-vsftpd.local -O /etc/fail2ban/filter.d/vsftpd.local
|
||||||
|
|
||||||
#Restarting and enableing services
|
#Restarting and enableing services
|
||||||
systemctl enable vsftpd sshd
|
systemctl enable vsftpd sshd fail2ban
|
||||||
systemctl restart vsftpd sshd
|
systemctl restart vsftpd sshd fail2ban
|
||||||
|
|||||||
Reference in New Issue
Block a user