Operating System - HP-UX
1829585 Members
1598 Online
109992 Solutions
New Discussion

Re: How to get date of last password created

 
Hongtao Yang
Occasional Contributor

How to get date of last password created

OS: HP-UX 11i v2 a/o v3
How can I get the date of the last password created for any user?
For example: uer Joe create his password on Nov. 11, 2008. Is there any command could report when Joe created his last password on the date?

Any help and comments
Thanks
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: How to get date of last password created

If you have password expiration, you can get when it was reset and when it expires, on a granularity of a week. Trusted systems can do better.
See my C program here:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1282383
Tingli
Esteemed Contributor

Re: How to get date of last password created

If the user account has expiration day, the command:

# /bin/passwd -s joe
joe PS 09/02/08 21 91 7

Here, 9/20/08 is the date of password reset. 21, 91, 7 are the...(check the man page)
Patrick Wallek
Honored Contributor

Re: How to get date of last password created

If the system is trusted you can run:

/usr/lbin/getprpw -m spwchg username

This will display the date & time that the password was last SUCCESSFULLY changed.
Keith Jahn
Advisor

Re: How to get date of last password created

If the system is not trusted, the most useful output is from "logins".

e.g. To get the output for one user colon-delimited.

logins -xtol username

To get the output for all users colon-delimited:

logins -xto

Beware that dates are MMDDYY format and that if the password has never been changed the date is 000000 .