我安装了新的 Ubuntu 16.04 LTS 服务器。我想用 保护它fail2ban
,但是当我尝试安装软件包时出现错误。
我该如何解决这个问题?
> apt-get install fail2ban
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
fail2ban is already the newest version (0.9.3-1).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
1 partiellement installés ou enlevés.
Après cette opération, 0 o d'espace disque supplémentaires seront utilisés.
Souhaitez-vous continuer ? [O/n] o
Paramétrage de fail2ban (0.9.3-1) ...
Job for fail2ban.service failed because the control process exited with error code. See "systemctl status fail2ban.service" and "journalctl -xe" for details.
invoke-rc.d: initscript fail2ban, action "start" failed.
dpkg: erreur de traitement du paquet fail2ban (--configure) :
le sous-processus script post-installation installé a retourné une erreur de sortie d'état 1
Des erreurs ont été rencontrées pendant l'exécution :
fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)
> 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 mar. 2016-11-15 16:02:23 CET; 2min 43s ago
Docs: man:fail2ban(1)
Process: 11301 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Control process exited, code=exited status=255
nov. 15 16:02:23 MBjumpbox systemd[1]: Failed to start Fail2Ban Service.
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Unit entered failed state.
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Failed with result 'exit-code'.
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
nov. 15 16:02:23 MBjumpbox systemd[1]: Stopped Fail2Ban Service.
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Start request repeated too quickly.
nov. 15 16:02:23 MBjumpbox systemd[1]: Failed to start Fail2Ban Service.
/var/log/fail2ban.log
是空的:
ls -l /var/log/fail2ban.log
-rw-r----- 1 root adm 0 nov. 15 16:02 /var/log/fail2ban.log
答案1
好的,最后我解决了它:
- apt-get 删除 fail2ban
- apt-get 自动删除
- apt-get 安装 fail2ban
答案2
通过以下方法解决。
apt-get remove fail2ban
apt-get autoremove
rm -rf /etc/fail2ban/
apt-get install fail2ban
答案3
用户可编辑的文件是 jail.local。16.04 版本上的 Jail.conf 需要复制到新的 jail.local 文件中。然后,您手动“比较”旧的 .local 和新的 .local 文件,并手动复制所有更改。这为我解决了问题!