update : not good
This commit is contained in:
7
03-Fail2ban/defaults-debian-ssh.conf
Normal file
7
03-Fail2ban/defaults-debian-ssh.conf
Normal 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
7
03-Fail2ban/jail.local
Normal 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
31
03-Fail2ban/script.sh
Normal 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}"
|
Reference in New Issue
Block a user