linux查看某IP尝试连接成功和失败次数

查看连接失败次数

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

查看连接成功次数

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

原文地址:https://www.cnblogs.com/tiandsp/p/8079480.html