how do i list all user accounts that have expired?

  • Follow


is there a way to list all user accounts that have expired in solaris
8/9? also how do i decipher that expiry number in /etc/shadow and
convert it to regular date format?

0
Reply dwaynek (2) 3/21/2006 9:32:38 PM

assuming your talking about local accts and not ldap!
Try :-

perl -F: -lane 'print($F[0]," expires ", scalar localtime($F[7]*86400))
if ($F[7]) && ($F[7] lt int(time/(60*60*24)))' /etc/shadow
testone expires Tue Feb 21 00:00:00 2006
testtwo expires Sun Feb 13 00:00:00 2000

I'm not a perl expert so probably a better way of doing above -
basically shadow file has number of days since jan 1st 1970 - compares
this to todays date and prints if its less (ie expiry date is in past!)


Kind Regards

Stuart.

0
Reply stuart_abrams_humphr 3/22/2006 3:58:58 PM


1 Replies
1071 Views

(page loaded in 0.109 seconds)

Similiar Articles:













7/22/2012 2:20:06 AM


Reply: