Hello, I am trying to track failed login attempts in SCO. I have used a script that I got from a forum here and it has worked to a degree. Here is the script I used:
cd /tcb/files/auth
awk -F: '
{for(i=1;i<=NF;++i)if($i~/unsuclog/)print substr(FILENAME,3),$i}
' ?/* | while read user date
do echo "$user\t$(perl -e 'use POSIX;print ctime($date)')"
done
and here is the result:
dpalmer $(perl -e 'use POSIX;print ctime(u_unsuclog#1239206368)')
I would love to get a proper date and time when the unsuccessful login took place. Could someone please tell me what's wrong with the code?
cd /tcb/files/auth
awk -F: '
{for(i=1;i<=NF;++i)if($i~/unsuclog/)print substr(FILENAME,3),$i}
' ?/* | while read user date
do echo "$user\t$(perl -e 'use POSIX;print ctime($date)')"
done
and here is the result:
dpalmer $(perl -e 'use POSIX;print ctime(u_unsuclog#1239206368)')
I would love to get a proper date and time when the unsuccessful login took place. Could someone please tell me what's wrong with the code?