All Products
Search
Document Center

Elastic Compute Service:Reset the logon password of an instance from within the instance

Last Updated:Aug 31, 2023

After you connect to an Elastic Compute Service (ECS) instance, you can reset the logon password of the instance. This eliminates the need to log on to the ECS console. After you reset the logon password of an instance from within the instance, the reset operation immediately takes effect. You do not need to restart the instance. This topic describes how to reset the logon passwords of a Linux instance and a Windows instance from within the instances. In this topic, Windows and CentOS operating systems are used.

Usage notes

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

  • Lowercase letters

  • Uppercase letters

  • Digits

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

Note

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

Reset the logon password of a Linux instance

In this example, CentOS 7.8 is used. To reset the logon password, perform the following steps:

  1. Connect to the Linux instance.

    For more information, see Connect to a Linux instance by using a password or key.

  2. Run the following command to reset the logon password:

    sudo passwd <Username>
  3. Enter a new password and press the Enter key.

  4. Enter the new password again and press the Enter key.

    A command output similar to the following one indicates that the logon password of the Linux instance is reset.

    实例登录.png

Reset the logon password of a Windows instance

In this example, Windows Server 2019 is used. To reset the logon password, perform the following steps:

  1. Connect to the Windows instance.

    For more information, see Connect to a Windows instance by using a password or key.

  2. On the Windows desktop, right-click the image.png icon and then select Run. In the Run window, enter compmgmt.msc and press the Enter key.

  3. In the Computer Management window, choose Computer Management > Local Users and Groups > Users.

  4. Right-click a username, such as Administrator, and select Set Password.

  5. In the Set Password for Administrator window, click Proceed. Enter a new password in the New Password field. Then, enter the password in the Confirm Password field.

  6. Click OK.

    A window similar to the following one indicates that the logon password of the Windows instance is reset.

    image.png