Operating System - HP-UX
1833138 Members
3630 Online
110051 Solutions
New Discussion

Re: Determining expired password

 
Lukas Grijander
Advisor

Determining expired password

Hi all.

I need to determine when a password has expired.

Where can I find information about the password field of /etc/passwd file ?

Thanks and best regards.
Rafa
5 REPLIES 5
Michael Tully
Honored Contributor

Re: Determining expired password

Your system seems to be un-trusted. Have a look at the man 4 passwd.

# man 4 passwd

This gives all of the codes needed. If your system is trusted you need to look at the 'getprpw' man page. Here is the link to where you can find it. By default this man page is not installed.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xe505a22d6d27d5118fef0090279cd0f9,00.html

Cheers
~Michael~
Anyone for a Mutiny ?
Robin Wakefield
Honored Contributor

Re: Determining expired password

Hi Rafa,

Do a "man 4 passwd", this should explain the expiration characters.

Rgds, Robin
Pete Randall
Outstanding Contributor

Re: Determining expired password

Rafa,

See the following thread, in particular, A. Clay Stephenson's response may prove useful:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x82afba808b46d611abda0090277a778c,00.html

HTH,
Pete

Pete
Nick Wickens
Respected Contributor

Re: Determining expired password

Because of a bug in informix I have to force passwords to change rather than let the system expire them. On our system at least I have found that if a password is expired, the year of the password last changed date gets set to 1970 (This may be just a quirk of our setup). I therefore use the following in a script, passing each user into the variable $USER -

/usr/lbin/getprpw -r -m spwchg $USER| tr - s " "|cut -d" " -f5

And if it returns 1970 the password is expired. There is probably a simpler way of doing this but it works for me.
Hats ? We don't need no stinkin' hats !!
Geetha Alagappan
Regular Advisor

Re: Determining expired password

Another way to check on expiring passwords is by issuing the logins command

logins -x -l username

The response will be in the foll format
username,IT,,
/home/username
/usr/bin/sh
PS 040302 14 182 -1

The above ..
1- password last change on 04/03/02
2- minimum time between changes 14 days
3- password expiration 182 days

hercules