以下是 fail2ban 日志的输出。没有显示任何其他内容,但在 auth.log 中我看到数百个 root 用户登录失败(有人在暴力破解)。
2011-07-06 01:48:16,249 fail2ban.server : INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.8.3
2011-07-06 01:48:16,250 fail2ban.jail : INFO Creating new jail 'ssh'
2011-07-06 01:48:16,250 fail2ban.jail : INFO Jail 'ssh' uses poller
2011-07-06 01:48:16,251 fail2ban.filter : INFO Added logfile = /var/log/auth.log
2011-07-06 01:48:16,252 fail2ban.filter : INFO Set maxRetry = 3
2011-07-06 01:48:16,253 fail2ban.filter : INFO Set findtime = 600
2011-07-06 01:48:16,253 fail2ban.actions: INFO Set banTime = 600
2011-07-06 01:48:16,329 fail2ban.jail : INFO Jail 'ssh' started
为什么它不阻止他们?我没有更改配置中的任何内容(除了 maxRetry)-我只是将它安装在我的 Linux Debian Lenny 上并且它启动了,但它没有阻止任何人。 :/
我该怎么做才能解决这个问题?
我可以分享一些攻击:
Jul 6 01:02:24 tornado sshd[19768]: Failed password for root from 200.63.212.41 port 43457 ssh2
Jul 6 01:02:26 tornado sshd[19771]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=www.gamavision.com user=root
Jul 6 01:02:27 tornado sshd[19771]: Failed password for root from 200.63.212.41 port 43565 ssh2
Jul 6 01:02:29 tornado sshd[19773]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=www.gamavision.com user=root
Jul 6 01:02:31 tornado sshd[19773]: Failed password for root from 200.63.212.41 port 43662 ssh2
Jul 6 01:02:32 tornado sshd[19775]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=www.gamavision.com user=root
顺便问一下,据我所知,服务器时间差 1 小时,这有什么改变吗?;D
编辑:
Status for the jail: ssh
|- filter
| |- File list: /var/log/auth.log
| |- Currently failed: 0
| `- Total failed: 0
`- action
|- Currently banned: 0
| `- IP list:
`- Total banned: 0
在我安装 fail2ban 之前,我在 auth.log 中注意到了这样的几行:
reverse mapping checking getaddrinfo for server1.intensevps.com [94.75.242.39] failed - POSSIBLE BREAK-IN ATTEMPT!
会不会是 fail2ban 与其他东西冲突了?我只是不知道是什么东西检测到了可能的入侵。现在安装了 fail2ban 后,它就检测不到任何东西了。
答案1
我也遇到过同样的问题。其实时间不同步。
dpkg-reconfigure tzdata
cp /usr/share/zoneinfo/Europe/Paris /etc/localtime
vim /etc/rsyslog.conf
#see all messages
$RepeatedMsgReduction off
service rsyslog restart
答案2
您需要启用 fail to ban 才能使其正常工作。只需运行“service fail2ban start”
答案3
尝试将“logpath”设置为“/var/log/secure”。