LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (http://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   command to findout password expiry date (http://www.linuxquestions.org/questions/solaris-opensolaris-20/command-to-findout-password-expiry-date-4175448534/)

manoj.linux 02-04-2013 03:22 AM

command to findout password expiry date
 
Hi,

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?

shivaa 02-04-2013 04:13 AM

It can be checked in /etc/shadow file in it's 8th field.
Code:

~$ grep 'username' /etc/shadow
OR
~$ awk -F":" '/username/ {print $8}' /etc/shadow

It contains the date when the user account expires once exceeded.

As per manual of shadow:
Quote:

expire

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:
Code:

~$ man passwd
~$ man shadow



All times are GMT -5. The time now is 07:43 AM.