2

启用 sshd jail 后,我Starting fail2ban: ERROR NOK: ("Failed to initialize any backend for Jail 'sshd'",) ERROR NOK: ('sshd',) 在日志中看到: ERROR Backend 'systemd' failed to initialize due to No module named systemd ERROR Failed to initialize any backend for Jail 'sshd'

Centos 6.7 没有 systemd 模块。CentOS 6.7,python 2.6

4

3 回答 3

4

只需将您的监狱配置后端替换为自动 From

[sshd]
enabled = true
filter = sshd
port    = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s

[sshd]
enabled = true
filter = sshd
port    = ssh
logpath = %(sshd_log)s
backend = auto

并重启服务service fail2ban restart

于 2017-02-18T21:46:20.077 回答
1

这个错误的原因是安装后fail2ban配置文件/etc/fail2ban/paths-fedora.conf包含几行,将某些应用程序的后端设置为systemd,这在 CentOS 6.x 中不存在。

只需删除所有字符串,例如

syslog_backend = systemd
sshd_backend = systemd
dropbear_backend = systemd
proftpd_backend = systemd
pureftpd_backend = systemd
wuftpd_backend = systemd
postfix_backend = systemd
dovecot_backend = systemd

from /etc/fail2ban/paths-fedora.conf(或使用 grep 搜索包含此类字符串的文件)。在这种情况下,您无需更改backend = %(sshd_backend)sbackend = auto- 没有此类更改,一切都会正常工作。

于 2018-03-11T20:33:27.020 回答
0

我可以通过编辑以下paths-common.conf文件来解决此问题:

default_backend = %(default/backend)s

至:

default_backend = pynotify或者default_backend = auto

于 2018-04-04T16:35:09.817 回答