From d47d07d62f97957b06a0b1332a9a41eb08de8573 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Fri, 14 Jun 2024 16:03:53 -0700 Subject: [PATCH] config f2b for Ubuntu or Debian --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 09c60bc..b34df0c 100644 --- a/install.sh +++ b/install.sh @@ -123,7 +123,12 @@ cp -a fail2ban/* /etc/fail2ban/ echo "destemail = $WEBMASTER" >> /etc/fail2ban/jail.local echo "bantime = 24h" >> /etc/fail2ban/jail.d/defaults-debian.conf echo "maxretry = 3" >> /etc/fail2ban/jail.d/defaults-debian.conf -echo "logpath = /var/log/auth.log tail" >> /etc/fail2ban/jail.d/defaults-debian.conf +if [ $os_codename = jammy ]; then + echo "backend = auto" >> /etc/fail2ban/jail.d/defaults-debian.conf + echo "logpath = /var/log/auth.log tail" >> /etc/fail2ban/jail.d/defaults-debian.conf +elif [ $os_codename = bookworm ]; then + echo "backend = systemd" >> /etc/fail2ban/jail.d/defaults-debian.conf +fi systemctl enable fail2ban systemctl start fail2ban