Ubuntu 16.04 fail2ban无法启动ubuntu 16.04

Ubuntu 16.04 fail2ban无法启动ubuntu 16.04,ubuntu-16.04,fail2ban,Ubuntu 16.04,Fail2ban,我使用本教程为我的Ubuntu 16.04服务器安装了fail2ban 在经历了这些之后,我尝试以:/etc/init.d/fail2ban start开始 答复如下: [....] Starting fail2ban (via systemctl): fail2ban.serviceJob for fail2ban.service failed because the control process exited with error code. See "systemctl status f

我使用本教程为我的Ubuntu 16.04服务器安装了fail2ban

在经历了这些之后,我尝试以:/etc/init.d/fail2ban start开始

答复如下:

[....] Starting fail2ban (via systemctl): fail2ban.serviceJob for fail2ban.service failed because the control process exited with error code. See "systemctl status fail2ban.service" and "journalctl -xe" for details.
失败了

然后运行时:
systemctl status fail2ban.service

我明白了:

> fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Tue 2018-05-15 14:01:38 UTC; 1min 40s ago
Docs: man:fail2ban(1)
Process: 4468 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)

May 15 14:01:38 tastycoders-prod1 systemd[1]: fail2ban.service: Control process exited, code=exited status=255
May 15 14:01:38 tastycoders-prod1 systemd[1]: Failed to start Fail2Ban Service.
May 15 14:01:38 tastycoders-prod1 systemd[1]: fail2ban.service: Unit entered failed state.
May 15 14:01:38 tastycoders-prod1 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
May 15 14:01:38 tastycoders-prod1 systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
May 15 14:01:38 tastycoders-prod1 systemd[1]: Stopped Fail2Ban Service.
May 15 14:01:38 tastycoders-prod1 systemd[1]: fail2ban.service: Start request repeated too quickly.
May 15 14:01:38 tastycoders-prod1 systemd[1]: Failed to start Fail2Ban Service.

DigitalOcean的一些教程包含错误。检查您的
/etc/fail2ban/jail.local
。尽量保持简单,即只保留那些你想更改的选项

否则,如果您已将
jail.conf
复制到
jail.local
(根据DO的指南),则在
jail.local
文件中删除或注释掉pam部分(如果不使用)

转至/etc/fail2ban/jail.local的第146行

# [pam-generic]

# enabled  = false
# pam-generic filter can be customized to monitor specific subset of 'tty's
# filter   = pam-generic
# port actually must be irrelevant but lets leave it all for some possible uses
# port     = all
# banaction = iptables-allports
# port     = anyport
# logpath  = /var/log/auth.log
# maxretry = 6
详情如下: