Skip to content

Instantly share code, notes, and snippets.

@rietta
Created May 21, 2012 11:50
Show Gist options
  • Save rietta/2761988 to your computer and use it in GitHub Desktop.
Save rietta/2761988 to your computer and use it in GitHub Desktop.
Get list of IP addresses that have failed to login to SSH from the /var/log/auth.log SSHD log.
A method for getting a list of IP addresses that failed to login to SSH from the /var/log/auth.log.
For just failed root login attempts:
grep "Failed password for root from" /var/log/auth.log | cut -d " " -f 11 | sort | uniq -c
For invalid user failed login attempts:
grep "Failed password for invalid user" /var/log/auth.log | cut -d " " -f 13 | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment