Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
cancel
Showing results for 
Search instead for 
Did you mean: 

account expiry info

himacs
Super Advisor

account expiry info

Hi Gurus,

How to check whether account is expired or not.

HPUX 11.23

Regards
himacs
5 REPLIES
Mel Burslan
Honored Contributor

Re: account expiry info

If you are using a trusted system (but don't use it as it will be deprecated after hpux 11.31) you might want to check this command:

# /usr/lbin/getprpw

Fields that you may be interested in are

exptm=180
spwchg=Mon Jan 3 14:45:21 2011
expwarn=14

Which tells you, last successful passwd change was on Jan 3rd 2011 at 14:45 and it will expire 180 days after this date.

you might write a little script around this information to see if it is already expired or not, if you want to automate the process for tons of user names. Otherwise you should be able to figure out the case just by looking at the date and exptime period specified in the output.

Good luck.
________________________________
UNIX because I majored in cryptology...
himacs
Super Advisor

Re: account expiry info

Hi Mel,

Thanks for the response. Actually i wanted to know whether there is any single command which tells account's current status with straight manner.

My getprpw tells,exptm has value -1.I think account expiration is disabled.

Regards
himacs

Mel Burslan
Honored Contributor

Re: account expiry info

You are right. -1 in any field means the check for that field is not valid, i.e. disabled. Unfortunately, unless someone in your organization has written a wrapper script around getprpw command, this is the best output you will get with the tools provided with hpux. I know it is not a pretty output but most unix command outputs are that way anyhow.
________________________________
UNIX because I majored in cryptology...
P Arumugavel
Respected Contributor

Re: account expiry info

hi,

#/usr/sbin/userstat -a

#passwd -s username

#passwd -sa


Rgds...
himacs
Super Advisor

Re: account expiry info

Hi Vels,

Thanks for the response.userstat command is not available with 11.23

I am closing this thread

Regards
himacs