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:
( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; ' < > , . ? /
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:
Connect to the Linux instance.
For more information, see Connect to a Linux instance by using a password or key.
Run the following command to reset the logon password:
sudo passwd <Username>
Enter a new password and press the
Enter
key.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.
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:
Connect to the Windows instance.
For more information, see Connect to a Windows instance by using a password or key.
On the Windows desktop, right-click the icon and then select Run. In the Run window, enter
compmgmt.msc
and press theEnter
key.In the Computer Management window, choose
.Right-click a username, such as Administrator, and select Set Password.
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.
Then, click OK.
A window similar to the following one indicates that the logon password of the Windows instance is reset.
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.