The chage command can be used to view and change a user account’s password expiration information. The root user can modify information such as the account expiration date, the minimum and maximum number of days between password changes, the number of days before account expiration that the system will warn the user, etc.
Here is a list and a brief description of the options available with the chage commands:
For example, we can list all the password expiration information for the bob user by using the following command:
As you can see from the picture above, bob’s password is set to never expire. We can change that with the following command:
Now, the bob’s password is set to expire 30 days from the day the command was run.