Adding ProFTPD jail rule to Fail2Ban

This commit is contained in:
myvesta 2025-05-25 13:51:13 +02:00
parent ff7bc2baa5
commit fa8dd64c5a
2 changed files with 42 additions and 1 deletions

View file

@ -1690,6 +1690,20 @@ if [ "$fail2ban" = 'yes' ]; then
chmod 640 /var/log/auth.log
chown root:adm /var/log/auth.log
fi
if [ "$proftpd" = 'yes' ]; then
cat <<EOF >> /etc/fail2ban/jail.local
[proftpd]
enabled = true
filter = proftpd
action = vesta[name=FTP]
port = ftp,ftp-data,ftps,ftps-data
logpath = %(proftpd_log)s
backend = %(proftpd_backend)s
maxretry = 5
EOF
fi
#update-rc.d fail2ban defaults
currentservice='fail2ban'
ensure_startup $currentservice