LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-28-2013, 02:33 AM   #1
rajini23
Member
 
Registered: Sep 2011
Posts: 162

Rep: Reputation: Disabled
Unhappy wants to know last password change date..


Hi,

I wants to know when was the last password changed for the user in solaries9 machine,
please help me in finding the last date of password changed...
 
Old 03-28-2013, 07:58 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Just go through the manual page of 'shadow'.

However, if you will check /etc/shadow file, its 3rd field is for last change, that is, number of day between Jan 1, 1970 and the date that the password was last modified.
Thus, calculate time elapsed between today and 1970-Jan-1 and substract that value from 3rd field of /etc/shadow, and you will get no. of days that the password was last changed.

As per it's manual:
Code:
~$ man shadow


     Each entry in the shadow file has the form:

     username: password:lastchg:min:max:warn:inactive:expire:flag

     lastchg         The number of days between January 1,  1970,
                     and  the  date  that  the  password was last
                     modified. The lastchg  value  is  a  decimal
                     number, as interpreted by atol(3C).
 
Old 04-01-2013, 12:53 PM   #3
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
I usually figure it out by resetting my password (so it will represent the current date) and then compare the 3rd column number to mine to determine how long ago they set it.
 
Old 04-02-2013, 12:32 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
This would work too:
Code:
nawk 'BEGIN{srand();print srand()/(24*3600)}'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the content of files but not change the date ust Linux - Newbie 1 12-17-2012 10:48 AM
LXer: How to change Thunderbird's date format in Date column LXer Syndicated Linux News 0 07-18-2012 02:11 AM
Ubuntu 11.04 encrypted LVM password not working after user login password change prateekm21 Linux - Security 0 10-29-2011 01:20 PM
How can I change e-mail password(or linux account password) with php in website?? yusuf Programming 1 05-28-2004 09:39 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 04:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration