Creating an Execution User

Configuring Password Aging

For security purposes, run the chage command to set the validity period of a password.

The command is as follows:

chage [-m minimum days] [-M maximum days] [-d last day] [-I inactive] [-E expiration date] [-W warning days] user

Table 1 describes the parameters.

Table 1 Password aging

Parameter

Description

-m

Minimum number of days between password changes. 0 indicates that you can change your password at any time.

-M

Maximum number of days during which a password is valid. -1 will remove checking a password's validity and may cause security risks. You are not advised to set this parameter to -1 unless extremely necessary.

-d

Date of the last password change.

-I

Number of inactive days after the password expiration before the account is locked.

-E

Date on which the account is locked.

-W

Number of days of warning before a password change is required.

-l

Lists account aging information.

  • Table 1 lists only common chage parameters. You can run the chage --help command to learn other chage parameters.
  • The date is in the format of YYYY-MM-DD. For example, chage -E 2019-12-01 test indicates that the test user will expire on December 1, 2019.
  • If user is not specified, the settings will be applied to the root user by default.

For example, to make the test user expire on December 31, 2019, run the following command:

chage -E 2019-12-31 test