我在/var/log/fail2ban.log中有多个实例,如下所示:
2015-12-27 14:31:21,949 fail2ban.filter [1020]: INFO [sshd] Found ###.###.###.###
(其中#代替了多种IP地址。)
该日志条目的确切含义是什么?特别是什么Found
表示?
我在这里和http://www.fail2ban.org上搜索了该日志文件的说明。如果我错过了这个问题的明显信息来源,我深表歉意-请指出正确的方向。
这是/etc/fail2ban/filter.d/sshd.config中FailRegex的配置:
failregex = ^%(__prefix_line)s(?:error: PAM: )?[aA]uthentication (?:failure|error) for .* from <HOST>( via \S+)?\s*$
^%(__prefix_line)s(?:error: PAM: )?User not known to the underlying authentication module for .* from <HOST>\s*$
^%(__prefix_line)sFailed \S+ for .*? from <HOST>(?: port \d*)?(?: ssh\d*)?(: (ruser .*|(\S+ ID \S+ \(serial \d+\) CA )?\S+ %(__md5hex)s(,$
^%(__prefix_line)sROOT LOGIN REFUSED.* FROM <HOST>\s*$
^%(__prefix_line)s[iI](?:llegal|nvalid) user .* from <HOST>\s*$
^%(__prefix_line)sUser .+ from <HOST> not allowed because not listed in AllowUsers\s*$
^%(__prefix_line)sUser .+ from <HOST> not allowed because listed in DenyUsers\s*$
^%(__prefix_line)sUser .+ from <HOST> not allowed because not in any group\s*$
^%(__prefix_line)srefused connect from \S+ \(<HOST>\)\s*$
^%(__prefix_line)sReceived disconnect from <HOST>: 3: \S+: Auth fail$
^%(__prefix_line)sUser .+ from <HOST> not allowed because a group is listed in DenyGroups\s*$
^%(__prefix_line)sUser .+ from <HOST> not allowed because none of user's groups are listed in AllowGroups\s*$
^(?P<__prefix>%(__prefix_line)s)User .+ not allowed because account is locked<SKIPLINES>(?P=__prefix)(?:error: )?Received disconnect from$
^(?P<__prefix>%(__prefix_line)s)Disconnecting: Too many authentication failures for .+? \[preauth\]<SKIPLINES>(?P=__prefix)(?:error: )?Co$
^(?P<__prefix>%(__prefix_line)s)Connection from <HOST> port \d+(?: on \S+ port \d+)?<SKIPLINES>(?P=__prefix)Disconnecting: Too many authe$
^%(__prefix_line)spam_unix\(sshd:auth\):\s+authentication failure;\s*logname=\S*\s*uid=\d*\s*euid=\d*\s*tty=\S*\s*ruser=\S*\s*rhost=<HOST$
在filter.d / sshd.conf中,您的FailRegex是什么?fail2ban.org/wiki/index.php/MANUAL_0_8#Filters
—
Frank Thomas
(将FailRegex添加到原始帖子中。)
—
nmax
根据我的日志10:1,ssh是黑客最喜欢的首选。这很可能是其中之一连接到您的系统。我有超过10,000多个IP,仅用于ssh。
—
cybernard
filter.d / sshd.conf中的任何其他正则表达式模式是否包含单词“ Found”?
—
Frank Thomas
奇怪的是,字符串'Found'不会出现在sshd.conf或/ etc / fail2ban中的任何文件中。@cybernard我绝对同意;问题在于fail2ban已经禁止ssh尝试,并且系统上已禁用基于密码的ssh(仅基于密钥的ssh)。
—
nmax