Linux chage command - Change Age

chage stands for 'change age'. This command is used to change user password expiry information.

Syntax:

chage [options] LOGIN

Examples:

1. List the password aging information of a particular user:
$chage -l <username>


From the above output, you can observe that the password expiration is disabled for this user.

2.  Change password expiry date:
Use -M option to change the password expiry date, it accepts the number of days after which password will expire.

You can use -m option which is the minimum number of days between password change. A value of zero means the user can change the password at any date.

3. Change last password change date:

Use the -d option to change the last password change date. You can pass a number to this option or complete date


4. Disable Password aging for a particular user:
chage -I -1 -m 0 -M 99999 -E -1 <username>
-I --> Inactive
-m --> Minimum number of days
-M --> Maximumn number of days
-E --> Account expiry


5. Forcing users to change the password on next logon:
$sudo chage -d 0 <username>
This will reset “Last Password Change” to “Password must be changed”.

Comments

Popular posts from this blog

bb.utils.contains yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig

PR, PN and PV Variable in Yocto