文档首页> 进阶教程> 检查哪些尝试入侵服务器的ip命令

检查哪些尝试入侵服务器的ip命令

发布时间:2024-11-21 13:40       

buntu查看尝试登录服务器的ip,一般用来查看攻击ip来源:

grep "Failed password for root" /var/log/auth.log | awk '{print $11}' | sort | uniq -c | sort -nr | more

 

 

 

centos查看尝试登录服务器的ip,一般用来查看攻击ip来源:

cat /var/log/secure | awk '/Failed/{print $(NF-3)}'| sort| uniq -c| awk '{print $2"="$1;}'

然后将以上ip加入/etc/hosts.deny 文件,格式:all:114.115.116.117

扫一扫访问手机版
30+ 高防云产品
1000+企业的共同选择