Elfatih Blog

How to: grep failed password

grep failed password

grep 'Failed password' /var/log/auth.log | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"
grep 'Failed password' /var/log/auth.log | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | sort
grep 'Failed password' /var/log/auth.log | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | sort | uniq -c | sort -nr
grep 'Failed password' /var/log/auth.log |less
grep 'Failed password' /var/log/auth.log
grep -E 'Failed password.*root' auth.log
grep -E 'Failed password.*root' /var/log/auth.log
grep -E 'Failed password.*root' /var/log/auth.log |grep -v repeated
grep -E 'Failed password.*root' /var/log/auth.log |grep -v repeated | awk '{print $1,$2,$5,$14,$11}'
grep -E 'Failed password.*root' /var/log/auth.log |grep -v repeated | awk '{print $11}' |sort
grep -E 'Failed password.*root' /var/log/auth.log |grep -v repeated | awk '{print $11}' |sort | uniq -c
grep -E 'Failed password.*root' /var/log/auth.log |grep -v repeated | awk '{print $11}' |sort | uniq -c | sort -nr

line

Follow me

ELFATIH KHALID (Eng., MSc.) | Cyber Security Advisor