All Products
Search
Document Center

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

Last Updated:Feb 27, 2024

When you perform operations in the operating system of an instance, you can change the logon password based on your business requirements without logging on to the Elastic Compute Service (ECS) console. After you change the password, the new password immediately takes effect without the 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 operating systems of the instance. In the examples, instances that runs Alibaba Cloud Linux 3 and Windows are used.

Considerations

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 (/).

Procedure

Reset the logon password of a Linux instance

In this example, an instance that runs Alibaba Cloud Linux 3.2104 LTS 64-bit is used. To reset the logon password of the instance, 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, an instance that runs Windows Server 2019 is used. To reset the logon password of the instance, 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, re-enter the new password in the Confirm Password field.

  6. Then, click OK.

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

    image.png

References

If you forget the logon password after you create an ECS instance, you can set a new logon password for the instance in the ECS console. For more information, see Reset the logon password of an instance.