Operating System - HP-UX
1761363 Members
2845 Online
108901 Solutions
New Discussion юеВ

Command Line Password Expiration Notification

 
Mike Bray
Advisor

Command Line Password Expiration Notification

I've read quite a few of these posts but wondering if someone has already figured this out. On a trusted system, HPUX 11i with password aging set at 90 days with a 20-day notification. I see that HP somehow alerts you when you log in within those 20 days about your account ready to expire with the date and time. I'd like to get my hands on how they do this so that I could from the command line perhaps tell what accounts will be expiring. From there using Cron/Sendmail would allow an admin to see an automated email to you alerting you each morning (or whenever) that particular accounts are nearing expiration. Anybody have something like this? I'm surprised HP still hasn't added a feature for admin's to easily see what accounts are nearing expiration. Especially those application accounts rarely logged into by an actual user. Thanks and first post ever so bear with me....
4 REPLIES 4
Michael Schulte zur Sur
Honored Contributor

Re: Command Line Password Expiration Notification

Mike Bray
Advisor

Re: Command Line Password Expiration Notification

Thanks, I read those threads already and it provides some of what I'm looking for. What I really want is how HP does it so I can use it myself. Below is helpfull but doesn't go into detail like HP's return.

spectest:TEST $ passwd -r files -s spectest
spectest PS 10/23/03 0 90 20

Last successful login for root: Wed Jan 7 11:08:57 PST8PDT 2004 on tty
Last unsuccessful login for root: Wed Jan 7 12:36:10 PST8PDT 2004
Your password will expire on Wed Jan 21 13:25:37 PST8PDT 2004


You see this has much more detail and would be a nice tidbit of information to have dumped to a file so you could see ALL the accounts ready to expire with specific times, dates and what not. Clay's is close with the weeks but I was hoping someone has done what HP has been able to do. Somehow HP gives you all this info on an account that is nearing expiration.
Rajeev  Shukla
Honored Contributor

Re: Command Line Password Expiration Notification

Ok Here you go..
The logic how the system calculates that the password is going to expire is..
It looks at password protected database and sees when the password was succesfully changed (say x), and then sees what is the password aging for that user(say y).
Then y-x tells you how many days are left for the password to expire.
I have written a C program using this logic to exactly calculate the date when the password will expire and works great.
Use getprpwnam() and structure pr_passwd
let me know if you need further help in writing that C program.
Mike Bray
Advisor

Re: Command Line Password Expiration Notification

Thanks here to. I placed this in the general system admin area and closing out this location. I've got enough info to chew on for a while and appreciate the help.

Mike