Hi,
I've a problem regarding understanding of result of passwd -s command.
> passwd -s
abc PS 05/24/12 0 441
I'm not a super user. But i need to write a simple code for checking password expiry and send an email to the team id. Is there any other command or way to achieve this? Requesting help in this regard.
---------- Post updated at 05:49 PM ---------- Previous update was at 05:16 PM ----------
Hi, Got the info about passwd -s output
in the above eg.
abc=userid; PS=passworded; 05/24/12=date on which passwd was last changed; 0=minimum number of days between password changes; 441=maximum number of days the password is valid for the name
The best for you is to look at the man pages... since it seems there are variations between the diverse OS implementation ( just looked at HP-UX and AIX...)
man pages didn't give correct info of each of fields displayed for passwd -s ouput. Could anyone please guide in making a script for password aging with this output.
As a non-root user are you trying to write a script which only applies to the current logged-in user? As a non-root user you will be stopped from interrogating other users.
As root user, I find the logins command much more useful than passwd for password expiry details. Notably logins -xto which gives output which is easy to parse in a script. Beware of the American format dates if you are a UK user.