fail2ban/0.10.2
2019-08-23 15:07:09 +02:00
..
action.d Use helpers-common.conf from repository 'deb http://ncomputers.org/debian stretch main'. 2018-11-24 02:20:11 +01:00
filter.d Add filter for wordpress from wp-fail2ban.readthedocs.io/en/3.6/filters.html. Modify jail.local. 2018-11-23 16:53:26 +01:00
ip64tables Initial commit 2017-11-27 04:23:54 +01:00
jail.local 0.10.2/jail.local: add example configuration for roundcube authentication. 2019-08-23 15:07:09 +02:00
README.apt-install README.apt-install: correct dokumentaion. 2018-04-15 18:13:16 +02:00
README.logrotate Add documentation. 2017-11-28 03:55:22 +01:00
README.src-install Update documentation. 2017-11-28 04:31:05 +01:00
README.sytemd Update documentation. 2017-11-28 04:31:05 +01:00

# - Configure  fail2ban as systemd service
# -

cat << EOF > /etc/systemd/system/fail2ban.service
[Unit]
Description=Fail2Ban Service
Documentation=man:fail2ban(1)
After=network.target iptables.service firewalld.service ip6tables.service ipset.service ipt-firewall.service ip6t-firewall.service
PartOf=iptables.service firewalld.service ip6tables.service ipset.service ipt-firewall.service ip6t-firewall.service

[Service]
Type=simple
ExecStartPre=/bin/mkdir -p /var/run/fail2ban
ExecStart=/usr/local/bin/fail2ban-server -xf start
# if should be logged in systemd journal, use following line or set logtarget to sysout in fail2ban.local
# ExecStart=/usr/local/bin/fail2ban-server -xf --logtarget=sysout start
ExecStop=/usr/local/bin/fail2ban-client stop
ExecReload=/usr/local/bin/fail2ban-client reload
PIDFile=/var/run/fail2ban/fail2ban.pid
Restart=on-failure
RestartPreventExitStatus=0 255

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable fail2ban.service

# - An alternative systemd configuration
# -
cat << EOF > /etc/systemd/system/fail2ban.service
[Unit]
Description=Fail2Ban Service
Documentation=man:fail2ban(1)
After=network.target iptables.service firewalld.service ipt-firewall.service ip6t-firewall.service
PartOf=iptables.service firewalld.service ipt-firewall.service ip6t-firewall.service

[Service]
Type=forking
ExecStart=/usr/bin/fail2ban-client -x start
ExecStop=/usr/bin/fail2ban-client stop
ExecReload=/usr/bin/fail2ban-client reload
PIDFile=/var/run/fail2ban/fail2ban.pid
Restart=always

[Install]
WantedBy=multi-user.target
EOF