This commit is contained in:
2025-04-16 16:51:08 +02:00
parent 76d0b4a98a
commit 9d27cb1b59
8 changed files with 100 additions and 2 deletions

7
10-Fail2ban/jail.local Normal file
View File

@@ -0,0 +1,7 @@
[sshd]
enabled = true
port = 2222
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600

View File

@@ -16,5 +16,16 @@ apt install -y fail2ban >> /dev/null
echo "${YELLOW} * ${NOCOLOR} Installation composant : ${GREEN} OK"
echo "${NOCOLOR}"
cp 10-Fail2ban/jail.local /etc/fail2ban/jail.local >> /dev/null
echo "${YELLOW} * ${NOCOLOR} Relance de service"
echo "${NOCOLOR}"
systemctl enable fail2ban
systemctl start fail2ban
echo "${YELLOW} * ${NOCOLOR} Relance de service : ${GREEN} OK"
echo "${NOCOLOR}"
echo "${YELLOW} ** ${NOCOLOR} Fin du script : 10-Fail2Ban"
echo "${NOCOLOR}"