Operating System - HP-UX
1833104 Members
3434 Online
110051 Solutions
New Discussion

How can you find out when an account will expire.

 
SOLVED
Go to solution
Shawn Miller_2
Frequent Advisor

How can you find out when an account will expire.

I am using trusted systems. 11.00 HP_UX
Expiration settings are done from a system level and the indivual users use the system defaults.

The system has to know on what day or how many days it will expire the account and I am looking for a way to obtain that data. I need to do it from the command line with no gui.

Thanks for any suggestions.
3 REPLIES 3
Jean-Luc Oudart
Honored Contributor
Solution

Re: How can you find out when an account will expire.

A. Clay Stephenson
Acclaimed Contributor

Re: How can you find out when an account will expire.

The key to what you are trying to do is the getprpw command.

/usr/lbin/getprpw -m spwchg,exptm user

You got some math and parsing to do but that should get you started. Man getprpw for details. Notice how I neatly left the remainder as a student exercise (or maybe I just ain't smart enough to do it).
If it ain't broke, I can fix that.
Shawn Miller_2
Frequent Advisor

Re: How can you find out when an account will expire.

The getprpw does not help since indivual accounts do not have password expiration settings in them. (value is all -1) They are set from the system. It appears that the best bet is to use C basically using the pr_passwd system call. Thanks.