1

我安装了服务器FAIL2BAN,现在无法理解问题所在。

fail2ban-regex 找不到正则表达式,即使很简单:

fail2ban-regex "192.168.1.1" "<HOST>$"

和答案

Running tests
=============

Use regex line : <HOST>$
Use single line: 192.168.1.1


Results
=======

Failregex
|- Regular expressions:
|  [1] <HOST>$
|
`- Number of matches:
   [1] 0 match(es)

Ignoreregex
|- Regular expressions:
|
`- Number of matches:

Summary
=======

Sorry, no match

Look at the above section 'Running tests' which could contain important
information.

请告诉我可能是蜜蜂错误吗?

4

1 回答 1

0

我有这个:

找到“192.168.1.1”的匹配项,但没有找到“192.168.1.1”的有效日期/时间。请联系作者以获得对该格式的支持

因此,看起来它需要示例字符串中的日期时间。

例如,这很好用:

fail2ban-regex "03-12-2012 12:00:00 192.168.1.1" "<HOST>$"



Running tests
=============

Use regex line : <HOST>$
Use single line: 03-12-2012 12:00:00 192.168.1.1


Results
=======

Failregex
|- Regular expressions:
|  [1] <HOST>$
|
`- Number of matches:
   [1] 1 match(es)

Ignoreregex
|- Regular expressions:
|
`- Number of matches:

Summary
=======

Addresses found:
[1]
    192.168.1.1 (Mon Dec 03 12:00:00 2012)

Date template hits:
0 hit(s): MONTH Day Hour:Minute:Second
0 hit(s): WEEKDAY MONTH Day Hour:Minute:Second Year
0 hit(s): WEEKDAY MONTH Day Hour:Minute:Second
0 hit(s): Year/Month/Day Hour:Minute:Second
0 hit(s): Day/Month/Year Hour:Minute:Second
0 hit(s): Day/MONTH/Year:Hour:Minute:Second
0 hit(s): Month/Day/Year:Hour:Minute:Second
0 hit(s): Year-Month-Day Hour:Minute:Second
0 hit(s): Day-MONTH-Year Hour:Minute:Second[.Millisecond]
2 hit(s): Day-Month-Year Hour:Minute:Second
0 hit(s): TAI64N
0 hit(s): Epoch
0 hit(s): ISO 8601
0 hit(s): Hour:Minute:Second
0 hit(s): <Month/Day/Year@Hour:Minute:Second>

Success, the total number of match is 1

However, look at the above section 'Running tests' which could contain important
information.
于 2012-12-10T10:49:53.740 回答