Forum Discussion
JPrice_230829
Jan 07, 2016Nimbostratus
Thanks, I've never used the aureport command before. With some help from a coworker this is what I ended up with:
startday=$( aureport -au | tail -2 | head -1 | awk '{print $2}' )
starttime=$( aureport -au | tail -2 | head -1 | awk '{print $3}' )
failcount=$(aureport -au --start $startday $starttime | grep $USER | grep no | wc -l)
echo "Failed login attempts since your last successful login: ${failcount}"