Review your favorite Linux distribution.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.


  Search this Thread
Old 02-04-2013, 04:22 AM   #1
Registered: Aug 2007
Posts: 256

Rep: Reputation: 15
Question command to findout password expiry date


I would like to know is there command which will tell me when password will be expire and when last password was changed ?

like on linux chage -l <username?
Old 02-04-2013, 05:13 AM   #2
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
It can be checked in /etc/shadow file in it's 8th field.
~$ grep 'username' /etc/shadow
~$ awk -F":" '/username/ {print $8}' /etc/shadow
It contains the date when the user account expires once exceeded.

As per manual of shadow:

An absolute date expressed as the number of
days since the Unix Epoch (January 1, 1970).
When this number is reached the login can no
longer be used. For example, an expire value
of 13514 specified a login expiration of
January 1, 2007.
Also once go through manuals for more clear understanding:
~$ man passwd
~$ man shadow

Last edited by shivaa; 02-04-2013 at 05:17 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Password doesn't expire after expiry date sudh Linux - Software 3 01-04-2012 04:17 PM
how to check the password expiry date of a user? binary_0011 Other *NIX 1 06-04-2008 02:37 AM
Terminal Command to find out expiry date on user accounts Caighil Linux - Newbie 3 02-29-2008 05:47 PM
Can I retrieve certificate expiry date from an openssl certificate (command line) davee Linux - Security 1 07-21-2006 11:28 AM
Getting password expiry for all accounts in a single command jdc2048 Linux - Security 2 05-26-2004 09:14 AM

All times are GMT -5. The time now is 02:36 PM.

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