码迷,mamicode.com
首页 > 其他好文 > 详细

centos用lastb命令看失败登录记录

时间:2017-07-06 13:27:23      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:centos lastb 登录 登录失败 失败登录 暴力试密码

lastb |less

lastb |tail

lastb |head


可以写个脚本,失败多少次后,就扔到/etc/hosts.deny里面去

如:

lastb |awk ‘{print $3}‘ |sort |uniq -c |sort -rn |awk ‘{print $2}‘ |head -25 |while read L;do echo "sshd:$L" >> /etc/hosts.deny;done


不生效可能是因为ldd /usr/sbin/sshd后没找到libwrap.so.0


参考文章http://75clouds.blog.51cto.com/3054635/1669397

centos用lastb命令看失败登录记录

标签:centos lastb 登录 登录失败 失败登录 暴力试密码

原文地址:http://zhukeqiang.blog.51cto.com/8692790/1944941

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!