Operating System - HP-UX
1833042 Members
2393 Online
110049 Solutions
New Discussion

Retrieving password expiering date

 
SOLVED
Go to solution
Klaas D. Eenkhoorn
Regular Advisor

Retrieving password expiering date

All,

How can i retrieve the password expiering date of a users password.
I'm using a non trusted system and no NIS.

I was testing with the output of passwd -a -s but what i thought to be a date (the 11/27/03 part) "bz99999 PS 11/27/03 0 7" seems to be something else.
I've started testing on 27 November 2003 :`-)

Can someone help me ?
I want to be 1 step ahead of the regular password changing sceme of login and rlogin.

Klaas Eenkhoorn
5 REPLIES 5
Jean-Louis Phelix
Honored Contributor

Re: Retrieving password expiering date

Hi,

logins -a should do it.

Regards.
It works for me (© Bill McNAMARA ...)
Klaas D. Eenkhoorn
Regular Advisor

Re: Retrieving password expiering date

But how do i interpert this info ?

"bz99999 3101 group 105 Test login,,, -1 000000"

Where is the date ?

Kl@@S
Jean-Louis Phelix
Honored Contributor
Solution

Re: Retrieving password expiering date

Hi,

Sorry, but I made a mistake. You should rather use -x :

exemple :

foo:O74257ZI2iaLA,M.UP:....

This user has M.UP as password aging string.

M means 24 weeks (168 days) before expiration
. means 0
UP is the last change date

Login -x -l foo gives for the last line :

PS 092503 0 168 -1

PS --> valid password
092503 --> last pasword change (derived from UP)
168 --> numbers of days between passord changes (derived from M).

So change will occur a last on september 15 2003 + 168 days ...

Regards.

It works for me (© Bill McNAMARA ...)
Klaas D. Eenkhoorn
Regular Advisor

Re: Retrieving password expiering date

Ok, it's starting to come to me . . . or getting further away . . .

The output of passwd -a is "bz99999 PS 11/27/03 0 7".
A non trusted system calculates it's dates in weeks and it's weeks start on Theursday.
This means that login or rlogin will allways ask for a new password on Theursday ???

If a password is valid for example 14 day's (two whole weeks) and if i change this password on 2 December 2003 the date recorded in the passwd file will be 27 November 2003. (the first previous Theursday)
And the date the password expieres will be 11 December 2003 ???

Am i right ??

Klaas
Jean-Louis Phelix
Honored Contributor

Re: Retrieving password expiering date

Klass,

I agree ... Your passwd aging field begin with something like ',0.' for this user (see man 4 passwd)

Regards.
It works for me (© Bill McNAMARA ...)