DEV Community

Cover image for How to see all the password-related information of a user account in Linux?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

How to see all the password-related information of a user account in Linux?

Originally posted here!

To see all the password-related information of a user account, you can use the chage command followed by the -l flag (list flag) and then the user account name in the Linux terminal.

# See all password related
# information of user account
chage -l <USERNAME_HERE>
Enter fullscreen mode Exit fullscreen mode

For example, suppose we have a user account called john and we can view all the password related information for the user using the chage command like this,

# See all password related
# information of user account
chage -l john
Enter fullscreen mode Exit fullscreen mode

The command shows the information on :

  • Last password change date
  • Password expiry date
  • Password inactive date
  • Account expiry date
  • Minimum number of days between password change
  • Maximum number of days between password change
  • Number of days of warning before password expires

The output of the above command may look like this,

# OUTPUT

Last password change                                    : Aug 28, 2021
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7
Enter fullscreen mode Exit fullscreen mode

Try executing the above commands live on this online Linux terminal.

That's all 😃!

Feel free to share if you found this useful 😃.


Discussion (0)