Help Center > > FAQs> Passwords and Key Pairs> Passwords> How Can I Set the Validity Period of the Image Password?

How Can I Set the Validity Period of the Image Password?

Updated at: Jan 26, 2021 GMT+08:00

If an ECS cannot be logged in because of expired image password, you can contact the administrator for handling.

If the ECS can still be logged in, you can perform the following operations to set the password validity period.


The following operations use EulerOS 2.2 as an example.

  1. Log in to the ECS.
  2. Run the following command to check the password validity period:

    vi /etc/login.defs

    The value of parameter PASS_MAX_DAYS is the password validity period.

  3. Run the following command to change the value of parameter PASS_MAX_DAYS:

    chage -M 99999 user_name

    99999 is the password validity period, and user_name is the system user, for example, user root.

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

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

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?

Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel