I found a couple of useful commands over at http://centoshelp.org/security/securing-sshd/
Namely, the two that parse /var/log/secure to check attacked accounts/attacking IPs
I would really love to convert them to a simpler command that I can run with su, rather than trying to remember them.
I've tried shell scripts as well as a direct awk script, but I always get various errors, usually to do with the single quotations it seems, sometimes syntax though (depending on what combination of double quotes and single quotes I use or omit).
awk 'gsub(".*sshd.*Failed password for (invalid user )?", "") {print $1}' /var/log/secure* | sort | uniq -c | sort -rn | head -5
awk 'gsub(".*sshd.*Failed password for (invalid user )?", "") {print $3}' /var/log/secure* | sort | uniq -c | sort -rn | head -5
I can't seem to get the combination right, so any help would be much appreciated.