Operating System - HP-UX
1837154 Members
2429 Online
110112 Solutions
New Discussion

Re: Password expiry on trusted systems.

 
SOLVED
Go to solution
Geetha_1
Regular Advisor

Password expiry on trusted systems.

Is there a way to find out the exact date when a user's password will expire on a trusted HP-UX 11.0 system?

I know the /usr/lbin/getprpw -m spwchg userid gives the date the password was last changed but don't know the options for the getprpw command to get the date when the password will expire. Thanks.
7 REPLIES 7
Jeff Schussele
Honored Contributor

Re: Password expiry on trusted systems.

Hi,

Well, there's no direct way to do this woth a getprpw command.

What you could do is run

getprpw -m spwchg

to get the last successful PW change date.
Then look at the u_exp value in the /tcb/files/auth/system/default file & divide it by 60, 60 again & finally 24.
This will give you the PW lifetime in days & add that to the spwchg date.
Or convert the spwchg to epoch seconds & add u_exp to it & then convert back to date.
You could use Clay's caljd program to do any of the above.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Geoff Wild
Honored Contributor

Re: Password expiry on trusted systems.

Something like:

getprpw -m mintm,exptm,expwarn,lftm userid

man getprpw for more..

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geetha_1
Regular Advisor

Re: Password expiry on trusted systems.

Hi Jeff,
Is there a man page which gives the meaning of the fields u_exp etc. I'll look around for Clay's script. PS let me know if you know of a script that exists that will make my life easy. Thx!
Geetha.
A. Clay Stephenson
Acclaimed Contributor

Re: Password expiry on trusted systems.

Do a man prpwd; it will explain the meanings of these fields. I wound up writing a C program to do this using getprpwent() for this because it's easier to fill in the system defaults for those fields that are not explicitly set in the user's TCB entry. The script that is referenced is "caljd.sh"; it won't do the password caculations but it will easily do the date calculations.
If it ain't broke, I can fix that.
Geetha_1
Regular Advisor

Re: Password expiry on trusted systems.

Hi Clay,
Thanks. I found the script. I'll see the usage to figure out how to use it for what I need.
Geetha.
Arturo Galbiati
Esteemed Contributor
Solution

Re: Password expiry on trusted systems.

Geetha_1
Regular Advisor

Re: Password expiry on trusted systems.

Art,
Works great! Thank you.

Thanks for all your responses.
Geetha.