Help Center/ Bare Metal Server/ FAQs/ OS FAQ/ How Do I Set the Password Validity Period?
Updated on 2023-07-10 GMT+08:00

How Do I Set the Password Validity Period?

If you cannot log in to a BMS due to password expiry, contact the operation administrator.

If you can log in to the BMS, perform the following operations to set the password validity period:

  1. Log in to the BMS OS and run the following command to query the password validity period:

    vi /etc/login.defs

    The value of parameter PASS_MAX_DAYS indicates the password validity period.

  2. Run the following command to change the value of parameter PASS_MAX_DAYS in 1:

    chage -M 99999 user_name

    99999 is the validity period of the password, and user_name is a system user.

    You are advised to set the password validity period as needed and change it on a regular basis.

  3. Run vi /etc/login.defs to verify that the configuration has taken effect.
    Figure 1 Configuration verification