User Password Expiration and Aging Management in Linux

User Password Expiration and Aging Management in Linux

Passwords are crucial to maintaining safety and integrity of a system. As a Linux administrator, managing password is one of the core tasks. With password expiration, you force users to change their password. Password aging is similar to expiration except that you force users to change their password at regular intervals. In this article, learn how to manage password expiration and aging in Linux.

You can change a user’s password expiration date using the chage command. You can see the password aging information, the number of days password has remain unchanged, the number of days in between password change, among other details.

To get started and view the account aging information, you can utilize the -l flag like this:

Code:
# chage -l user2
It will display the following information:
  • Last password change
  • Password expires
  • Password inactive
  • Account expires
  • Minimum number of days between password change
  • Maximum number of days between password change
  • Number of days of warning before password expires
You can use the -d flag to set the number of days or number of days the password was last changed like this:

Code:
# chage -d 2018-02-11 user2
To set the number of days after which the account will no longer be accessible, use the -E flag like this:

Code:
# chage -E 2018-02-16 user2
In the above case, user2 will no longer be able to access his/her account after 16th February 2018. They’d have to contact the system administrator to get access.

To set the number of days of warning before password expiry, -W flag is needed like this:

Code:
# chage -W 10 user2
User2 will get notified 10 days before his/her account’s password expiry date.

For more information regarding the chage command and the available options, execute the following command:

Code:
# man chage
So that’s how you can manage password expiration and aging in Linux. You can also use the usermod command for modifying user account information. Proceed as per your preference.
Author
kumkumsharma
Views
2,463
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top