CHAGE(1)
โจ chage(1) โ the manual page, but make it cute โจ
okay so bestie, welcome to the User Commands section, this is chage(1) and she is iconic ๐
๐ NAME ๐
chage โ change user password expiry information ๐
๐ธ SYNOPSIS ๐ธ
chage [options] LOGIN
๐ฆ DESCRIPTION ๐ฆ
So chage changes password expiration info for a user. It sets the number of days between password changes and the date of the last password change. The system then uses that info to figure out when the user has to change their password. periodt โจ
๐ OPTIONS ๐
The options that apply to the chage command are, and yes we're doing all of them, no skips:
-d,--lastdayLAST_DAY โ Sets the date when the password was last changed. The value can be a date in theYYYY-MM-DDformat, or a number of days since1970-01-01. The date gets interpreted using the UTC timezone. If LAST_DAY is set to0, the user is forced to change their password at their next login. ๐ซถ
Passing the value -1 or an empty string as LAST_DAY clears the value and removes the password change requirement.
-E,--expiredateEXPIRE_DATE โ Sets the date on which the user's password expires and their account stops being accessible. The value can be a date inYYYY-MM-DDformat, or a number of days since1970-01-01. Interpreted using the UTC timezone. If the password expires, the user has to contact the system administrator to get access back. ngl, that's the vibe check failing fr fr
For example, this command sets an account to expire in 180 days:
chage -E $(date -d +180days +%F)
Passing the value -1 or an empty string as EXPIRE_DATE removes the account expiration date.
-h,--helpโ Displays the help message and exits. ๐-i,--iso8601โ When printing dates, useYYYY-MM-DDformat. Clean, crisp, iconic. โจ-I,--inactiveINACTIVE โ Sets the number of days of inactivity after a password has expired before the account gets locked. The INACTIVE option is that number of days of inactivity. A user whose account is locked must contact the system administrator before they can use the system again. ๐ญ
Passing the number -1 as INACTIVE removes an account's inactivity.
-l,--listโ Shows account aging information. ๐-M,--maxdaysMAX_DAYS โ Sets the maximum number of days a password is valid. When MAX_DAYS plus LAST_DAY is less than the current day, the user is required to change their password before they can use their account. You can plan for that in advance with the-Woption, which gives the user advance warning. ๐
Passing the number -1 as MAX_DAYS removes checking of a password's validity.
-R,--rootCHROOT_DIR โ Applies changes in the CHROOT_DIR directory and uses the configuration files from the CHROOT_DIR directory. Only absolute paths are supported. No SELINUX support. not me being limited like that-P,--prefixPREFIX_DIR โ Applies changes to configuration files under the root filesystem found under the directory PREFIX_DIR. This option does not chroot and is intended for preparing a cross-compilation target. Some limitations: NIS and LDAP users/groups are not verified. No SELINUX support. ๐-W,--warndaysWARN_DAYS โ Sets the number of days of warning before a password change is required. The WARN_DAYS option is the number of days prior to the password expiring that a user gets warned their password is about to expire. gentle heads-up energy ๐
If none of the options are selected, chage operates in an interactive fashion, prompting the user with the current values for all of the fields. Enter the new value to change the field, or leave the line blank to use the current value. The current value is displayed between a pair of [ ] marks. ๐
๐ NOTE ๐
The chage program requires a shadow password file to be available.
The chage program will report only the information from the shadow password file. This implies that configuration from other sources (e.g. LDAP, or an empty password hash field from the passwd file) that affect the user's login will not be shown in the chage output. ๐
The chage program will also not report any inconsistency between the shadow and passwd files (e.g. missing x in the passwd file). The pwck can be used to check for this kind of inconsistencies.
Thechagecommand is restricted to the root user, except for the-loption, which may be used by an unprivileged user to determine when their password or account is due to expire. so if you're not root,-lis your one (1) little treat ๐ซถ
๐ FILES ๐
/etc/passwdโ User account information./etc/shadowโ Secure user account information.
โญ EXIT VALUES โญ
The chage command exits with the following values:
0โ success โจ1โ permission denied ๐ซ2โ invalid command syntax ๐ต15โ can't find the shadow password file ๐
๐ SEE ALSO ๐
okay that's the whole page bestie, you ate that, no cap ๐ This was brought to you by shadow-utils 4.20.0, dated 07/30/2026 โ slay, see you next login ๐ โจ
๐ฆ where this page comes from
- arch rolling: shadow 4.20.0.arch1-1 ยท 0BSD AND BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms