Skip to main content

Forcing password changes in Linux - chage

 If you are like me - ultra paranoid, you are not happy with one password. You want to change the password frequently (before the hacker some how solves it ;) ). chage is the command for you.

chage - there is no n here - determines after how many days the password of a user expires. 

This is what man page says about it

 
       The chage command changes the number of days between password changes and the date of the last password change. This information is used by  the system to determine when a user must change his/her password.

You can set number of days after which password expires, when do you want to be prompted for it etc.

 $sudo chage username
[sudo] password for username:
Changing the aging information for username
Enter the new value, or press ENTER for the default

    Minimum Password Age [0]:
    Maximum Password Age [10]:
    Last Password Change (YYYY-MM-DD) [2021-08-26]:
    Password Expiration Warning [1]:
    Password Inactive [-1]:
    Account Expiration Date (YYYY-MM-DD) [-1]:


Comments