deb12 fail2ban auth.log fix

This commit is contained in:
myvesta 2023-06-17 23:00:40 +02:00 committed by GitHub
parent ce5fac9b07
commit 93a6d0b6e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1630,6 +1630,13 @@ if [ "$fail2ban" = 'yes' ]; then
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -) fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local
fi fi
if [ ! -e /var/log/auth.log ]; then
# Debian workaround: auth logging was moved to systemd
# We took this fix from HestiaCP
touch /var/log/auth.log
chmod 640 /var/log/auth.log
chown root:adm /var/log/auth.log
fi
#update-rc.d fail2ban defaults #update-rc.d fail2ban defaults
currentservice='fail2ban' currentservice='fail2ban'
ensure_startup $currentservice ensure_startup $currentservice