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, --lastday LAST_DAY โ€” Sets the date when the password was last changed. The value can be a date in the YYYY-MM-DD format, or a number of days since 1970-01-01. The date gets interpreted using the UTC timezone. If LAST_DAY is set to 0, 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, --expiredate EXPIRE_DATE โ€” Sets the date on which the user's password expires and their account stops being accessible. The value can be a date in YYYY-MM-DD format, or a number of days since 1970-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, use YYYY-MM-DD format. Clean, crisp, iconic. โœจ
  • -I, --inactive INACTIVE โ€” 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, --maxdays MAX_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 -W option, which gives the user advance warning. ๐ŸŒˆ

Passing the number -1 as MAX_DAYS removes checking of a password's validity.

  • -R, --root CHROOT_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, --prefix PREFIX_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, --warndays WARN_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.

The chage command is restricted to the root user, except for the -l option, 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, -l is 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 ๐ŸŒˆ

passwd(5), shadow(5).


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