1834624 Members
2547 Online
110069 Solutions
New Discussion

last passwd change

 
sandeep mathur
Respected Contributor

last passwd change


what is the command to see the last passwd change in hp-ux. in linux it is chage -l username.

thanks in advance.
10 REPLIES 10
Patrick Wallek
Honored Contributor

Re: last passwd change

If the system is trusted:

# passwd -s username

or

# /usr/lbin/getprpw -m spwchng username

If the system is not trusted:

# passwd -s username
Kapil Jha
Honored Contributor

Re: last passwd change

patrik:
I am not sure if sandeep is asking the information you have given.
passwd -s <>
would show only status
PS =passworded;
LK =locked; and
NP =no password.

What he want is to see when last passwd was changed.
I am not sure about this,other than see when passwd file was modified.

Please let me know if there is smthing like this.
BR,
Kapil
I am in this small bowl, I wane see the real world......
Patrick Wallek
Honored Contributor

Re: last passwd change

Did you try the command or read the man page for the '-s' option to passwd?

# passwd -s user
user PS 10/31/07 7 90 14

The above output means:
user=user
PS=status (check the man page for possible values)
10/31/07 = date password last changed
7=minimum password age
90=max password age
14=# of days to warn before password expires
sandeep mathur
Respected Contributor

Re: last passwd change

what kapil jha is telling is right but i wont get the last passwd changed when i use passwd -s username command.
Anshumali
Esteemed Contributor

Re: last passwd change

Patris is right Kapil....

but why this happned?

# passwd secroot
Changing password for secroot
New password:
Re-enter new password:
Passwd successfully changed (Today)
# passwd -s secroot
secroot PS 12/13/07 77 77 (Yesterday)
# date
Fri Dec 14 14:16:07 IST 2007
-----------

$ passwd -s secroot
secroot PS 12/13/07 77 77
$ id
uid=110(secroot) gid=20(users)



Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Anshumali
Esteemed Contributor

Re: last passwd change

Sandeep,

What OS version you are running....

Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Kapil Jha
Honored Contributor

Re: last passwd change

Hey output i was getting on my system is
# passwd -s user
user PS
I saw I had not activated password aging , and that is why this output.
U are absolutely right Patrick.
Sorry!!!!
BR,
Kapil
I am in this small bowl, I wane see the real world......
S.Rider
Regular Advisor

Re: last passwd change

A quick-ugly script that will get you the date the password was last changed for all usders on the system. It's formatted like it is because I combine the output with some other scripts that return the last-login-date and deactivated-reason.

Ride Boldly Ride, but watch out for El Dorado's
HGN
Honored Contributor

Re: last passwd change

Hi

You have assigned points to only 1 out of the 41 replies you have received, please read forum guidelines in assigning points.

Rgds

HGN
El Gordo Tramposo
New Member

Re: last passwd change

is very easy, with perl's script you obtain the last passwd change.

cat /tcb/files/auth/u/user

this parameter:
u_succhg#1196271850

and the command line with perl

perl -e 'print localtime(1196271850)."\n"'

Wed Nov 28 15:44:10 2007

bye