count ssh failed login

grep “Failed password for invalid user” /var/log/secure | awk ‘{print substr($13,8)}’ | awk ‘{count[$1]++} END  { for( i in count ) { if ( count[i] >= 3 ){print i ” Total Failed Attempts: ” count[i] “”} }}’

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.