Operating System - HP-UX
1832348 Members
3353 Online
110041 Solutions
New Discussion

Query password expiration?

 
SOLVED
Go to solution
Richard Ross
Regular Advisor

Query password expiration?

Running 11.11 Trusted server and looking for a way to determine if a userid's password has been expired (Not lifetime). I do not see this as a field in 'getprpw'

Thanks
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: Query password expiration?

Shalom,

The report from passwd -sa may be helpful.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Richard Ross
Regular Advisor

Re: Query password expiration?

This looks very minimalistic ..

jashaieb PS

I was looking more for pulling info out of getprpwent, but looks like fd_expire is equal to '0' on all users.
Arturo Galbiati
Esteemed Contributor

Re: Query password expiration?

Hi,
you can use pwage.
HTH,
Art
Arturo Galbiati
Esteemed Contributor

Re: Query password expiration?

Hi,
you you want I can provide youa script which uses pwage.
Let me know.
Art
Richard Ross
Regular Advisor

Re: Query password expiration?

Arturo,

I do not see pwage on the server .. 11.i v1

Thanks
Peter Godron
Honored Contributor
Solution

Re: Query password expiration?

Richard,
I hope I understand your request correctly:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=847387

See Bill's answer/script.
Richard Ross
Regular Advisor

Re: Query password expiration?

Peter .. Thanks .. This looks very promising ..

I did make one change. I changed '$PWDAYSLEFT -gt 1' to '-gt 0' so I can locate the userids whose passwords have already expired.


PWCHGDATE="$(echo 0d${SECS2EXP}=Y \
| adb \
| cut -c 3-13 \
| awk '{print $2,$3,$1}')"
if [ $PWDAYSLEFT -gt 0 ]
then
print "Password expires in $PWDAYSLEFT days ($PWCHGDATE)"
else
print "Password expired"
fi


Thanks again