错误在 /etc/fail2ban 下找不到“fail2ban”的可访问配置文件

jbl*_*blz 7 linux ubuntu fail2ban apt

所以我的 fail2ban 没有工作,为了让它工作,配置文件变得混乱。决定从头开始。

我以 sudo 的身份运行这些

apt-get remove fail2ban

apt-get purge fail2ban

rm -r /etc/fail2ban
Run Code Online (Sandbox Code Playgroud)

希望我能完全删除它,因为前两个命令保留了凌乱的配置文件。

所以现在当我 apt-get install fail2ban 它下载并安装包,但是当我尝试运行它时有这个

 * Starting authentication failure monitor fail2ban                                                                                                                                                                            ERROR  Found no accessible config files for 'fail2ban' under /etc/fail2ban
ERROR  No section: 'Definition'
ERROR  No section: 'Definition'
ERROR  Found no accessible config files for 'fail2ban' under /etc/fail2ban
ERROR  Found no accessible config files for 'jail' under /etc/fail2ban
ERROR  No section: 'Definition'
ERROR  No section: 'Definition'
Run Code Online (Sandbox Code Playgroud)

这些配置文件确实丢失了。为什么我重新安装 F2B 时没有重新创建它们?如何从头开始并将其重新安装为默认值?

我使用的是 Ubuntu 14.04.2 LTS

A-3*_*312 6

我解决了这个问题:

service fail2ban stop
rm -r /etc/fail2ban/
apt-get purge fail2ban

apt-get install fail2ban
Run Code Online (Sandbox Code Playgroud)


Leo*_*Leo 0

您应该在 /etc/fail2ban 中列出您的文件:

ls -lh /etc/fail2ban
Run Code Online (Sandbox Code Playgroud)

应该有一个ijil.conffail2ban.conf以及它们各自的jail.dfail2ban.dfilter.daction.d目录用于.conf文件。

filter.daction.d应填充不同服务的多个默认 .conf 文件。

该错误告诉您没有文件。

另外, /var/log/fail2ban.log中有什么?