This ‘password aging’ utility allows you to set an expire date for a user account password for better security.

First step is install chage if it’s not already installed. Then, you can type chage -l <username> to check chage settings for that username:

$ chage -l ricardo
Last password change                                    : sep 12, 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

To edit chage settings for a user you need to be a root user or use sudo.

# To expire a password after 90 days since last password change
chage -M 90 <username>
  • You can disable password expiration as well:
    chage -M -1 <username>
    

To expire a password inmediately (apply to next login):

chage -d 0 <username>

You can type chage <username> to enter on interactive mode and edit all settings.

Type chage --help to get more info.