All Products
Search
Document Center

Elastic Compute Service:Reset the logon password of an instance

Last Updated:May 23, 2024

If you did not set a logon password when you created an Elastic Compute Service (ECS) instance or if you forget the logon password of an ECS instance, you can use the password reset feature. This topic describes how to reset the logon password of an instance in the ECS console.

Background information

This topic focuses on how to reset the logon password of an instance in the ECS console. You can also use Cloud Assistant to reset the logon password of an instance, or connect to an instance and reset the logon password in the instance. The following table describes the comparison among the different methods.

Method

Instance restart

Instance logon

Required instance status

Cloud Assistant Agent

Reset the logon password of an instance in the ECS console

Online Reset

Not required.

Not required.

Running

Required.

  • Linux: Cloud Assistant Agent 2.2.3.398 or later.

  • Windows: Cloud Assistant Agent 2.1.3.398 or later.

For more information, see Install Cloud Assistant Agent.

Offline Reset

Required.

Not required.

Running or Stopped

Not required.

Change the logon password of an instance by using Cloud Assistant

Not required.

Not required.

Running

Required.

Reset the logon password of an instance from within the instance

Not required.

Required. You must connect to the instance, which is a complicated process.

Running

Not required.

Procedure

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instances.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Perform one of the following operations based on the number of instances whose logon passwords you want to reset at a time:

    • To reset the logon password of an instance, find the instance and choose image.png > Instance Attributes > Reset Instance Password in the Actions column.

    • To reset the logon password of multiple instances at a time, select the instances and choose image.png > Reset Instance Password in the lower part of the Instance page.

  5. In the Reset Instance Password dialog box, configure the parameters and click OK.

    image

    Parameter

    Description

    Logon Username

    • If you select the Online Reset method, you can specify a logon username and password or change the logon username and password that you specified when you created an instance.

    • If you select the Offline Reset method, you can change the password that you specified when you created an instance, but you cannot change the logon username.

    New Password and Confirm Password

    The password must be 8 to 30 characters in length and contain at least three types of the following characters:

    • Uppercase letters

    • Lowercase letters

    • Digits

    • Special characters: ( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; ' < > , . ? /

    Note

    For Windows instances, logon passwords cannot start with a forward slash (/).

    Password Reset Method

    • Online Reset: After you reset the password of an instance online, you do not need to restart the instance. The new password is expected to take effect within 1 minute. You cannot reset the passwords of multiple instances online.

      Important

      In this method, Cloud Assistant is used to encrypt and transfer the password text to prevent decryption and ensure password security.

    • Offline Reset: After you reset the password offline, you must restart or start the instance for the new password to take effect.

      • If the instance is in the Running state, click Restart Now.

        Warning

        The restart operation stops the instance for a short period of time and may interrupt services that are running on the instance. We recommend that you restart instances during off-peak hours.

      • If the instance is in the Stopped state, the new password takes effect when you start the instance.

    SSH Password Authentication

    This parameter is available only when Password Reset Method is set to Online Reset.

    • Enable: If you enable SSH Password Authentication, the system automatically sets the PasswordAuthentication parameter to yes in the /etc/ssh/sshd_config file. This allows you to connect to the instance by using SSH and log on with the specified password.

    • Retain Original Settings: If you select this option, you can change only the logon password of the instance.

  6. (Optional) Use the new password to log on to the ECS instance.

    For more information, see Connect to an instance.

    Note

    Although a key pair is bound to the instance, you can use the new password to log on to the instance after you reset the password.