1760583 Members
3518 Online
108894 Solutions
New Discussion юеВ

Re: variables password

 

variables password

Hello ALL

I??d like know how can I discovery the password,s age. For Example: The user change his password ysterday, and then made 2 (two) days . How can I get this number ??
Thanks for all !!!
rodriguescj
8 REPLIES 8
Christopher Caldwell
Honored Contributor

Re: variables password

If you use C (and trusted systems) try getprpwent.

Wodisch_1
Honored Contributor

Re: variables password

Hi,

you would have to use "password aging" on all the users where you need to collect/keep that piece of information. See the man page for "passwd(1M)" for the details (options -n and -x, IIRC).
Then the week (since 1970, 1st of Jan) is stored in the third and fourth character followinf the comma in the second field in your "/etc/passwd"... (modulo 64, of course and coded like this: /=0 .=1 0=2 ..9=11 A=12 .. z=63, again IIRC).

HTH,
Wodisch
Roger Baptiste
Honored Contributor

Re: variables password

hi,

you can try /usr/lbin/getprpw userid
and look for spwchg field in the output for the last password change.

HTH
raj
Take it easy.
Michael Tully
Honored Contributor

Re: variables password

If your system is trusted there are a few things you could look at.

last successful password change time
# /usr/lbin/getprpw -r -m spwchg fredb
Mon Jun 17 10:20:56 2002

Password expiry in days
# /usr/lbin/getprpw -r -m exptm fredb
3

Have a look at the man pages for this from this link:

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

HTH
Michael
Anyone for a Mutiny ?
Ian Kidd_1
Trusted Contributor

Re: variables password

If you have password aging, passwd -s {username} will give the date of the last successful change (3rd field). This won't work on 10.20, though.
If at first you don't succeed, go to the ITRC
Fragon
Trusted Contributor

Re: variables password

By the way, you can not find back your password in HP-UX.

live as you wish
ux
Ralph Grothe
Honored Contributor

Re: variables password

Just to foster the use of Perl,
the getpw* functions of the C lib are also available in Perl

e.g.

perl -e '$expire = (getpwuid 0)[9];printf "expiration for root: %s\n"
, defined $expire ? $expire : "not set"'

At the shell type for instance

perldoc -f getpwnam

to find out more...
Madness, thy name is system administration

Re: variables password

Is there some form to made a replication from /etc/passwd??
Because, we have 8 severs, and some users have user id in all servers.
PS: without use NIS.
Yhanks ???
rodriguescj