Managing the password configs for existing accounts is done through the passwd command, although there are other alternatives.

The options are configured in the config file /etc/login.defs.

As the file is located in the /etc directory, it will require root permissions to edit.

Article image

The section you want is near the middle of the file and is titled Password aging controls.

In it are three options, PASS_MAX_DAYS, PASS_MIN_DAYS, and PASS_WARN_AGE.

The default values for password aging controls can be found and configured in the file /etc/login.defs.

Article image

PASS_MAX_DAYS defaults to 99999 which is used to indicate that passwords should not automatically expire.

PASS_MIN_DAYS defaults to 0 which means that users can change their password as often as they like.

PASS_WARN_AGE defaults to seven days.

Article image

This value is only used if a users password is actually configured to expire.

Once youve made the changes you want, save the file.

Note: Unless mandated by policies, you should avoid configuring passwords to automatically expire over time.