There were xxx failed login attempts since the last successful login
当您通过shell登录到Linux(Ubuntu/CentOS/Redhat)时,可能会收到警告。
Last failed login: Fri Feb 23 08:09:01 CST 2024 from gutehomepage.de on ssh:notty
There were 196 failed login attempts since the last successful login.
Last login: Thu Feb 22 10:58:05 2024 from 27.195.172.242解决方法
1、查看登录失败的IP地址。
grep "Failed password for invalid user" /var/log/secure | awk '{print $13}' | sort | uniq -c | sort -nr得到
67083 172.232.61.112
8367 172.104.154.78
8332 164.92.165.198
201 61.164.170.242
199 185.98.83.220
193 122.176.52.13
192 106.14.61.79
191 139.59.128.142、将失败次数最多的IP加入hosts.allow文件即可。
cd /etc
cp hosts.allow hosts.allow.bak
vim hosts.allow在最下面加入以下内容即可。
sshd:172.232.61.112:deny
sshd:172.104.154.78:deny
sshd:164.92.165.198:deny 最后更新于1年前
本文由人工编写,AI优化,转载请注明原文地址: There were xxx failed login attempts since the last successful login
推荐阅读
评论 (0)
发表评论
昵称:加载中...
暂无评论,快来发表第一条评论吧!