This topic describes how to reset the logon password of an ECS instance. This topic is applicable to scenarios such as when you forget the password or when you did not set a password during instance creation.

Prerequisites

The instance is in a stable state, such as Stopped or Running. For more information about the status of an instance, see ECS instance lifecycle.

Background information

  • After you reset the logon password of an instance that is in the Running state, you must restart the instance to make the new password take effect. Restarting the instance may affect your services. We recommend that you reset the logon password during off-peak hours to avoid service disruption.
  • If the instance is a Linux instance, you can log on to the instance by using the password or the key pair. If you only use the password for authentication, this authentication method becomes invalid after you attach a key pair to your instance. If you want to use both methods to log on to the instance, you must reset its logon password.
  • You can also change the logon password of an instance by connecting to the instance. The change takes effect immediately and you do not need to restart the instance. For more information, see Change the logon password of an instance by connecting to the instance.

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 a region.
  4. Based on the number of instances for which you want to change passwords, you can perform different operations.
    • To reset the password of a single instance, find the target instance and choose More > Password/Key Pair > Reset Password in the Actions column.Reset the password of a single instance
    • To reset the password of multiple instances, select the target instances and click Reset Password below the instance list.Reset the password of multiple instances
  5. In the Reset Password dialog box that appears, enter a valid new password and click Submit.
  6. Based on the instance status, you can perform one of the following operations to make the new password take effect:
    • If the instance is in the Running state, click Restart Now.
    • If the instance is in the Stopped state, click Cancel and manually restart the instance.

      If you click Restart Now, an error will be displayed, indicating that this operation is not supported while the instance is in the current state. However, the password is already reset and will take effect the next time the instance starts.