update : not good

This commit is contained in:
2025-04-19 21:29:57 +02:00
parent 9d27cb1b59
commit e83894e30e
34 changed files with 1682 additions and 4 deletions

View File

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

7
03-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

31
03-Fail2ban/script.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/sh
# Pour la configuration Fail2Ban
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NOCOLOR='\033[0m'
echo "${YELLOW} ** ${NOCOLOR} Début du script : 10-Fail2Ban"
echo "${NOCOLOR}"
echo "${YELLOW} * ${NOCOLOR} Installation composant"
echo "${NOCOLOR}"
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}"