(Optional) Installing One-Click Password Reset Plug-ins
The public cloud platform provides the password reset function. If the password of your ECS is forgotten or expires and your ECS has had password reset plug-ins installed, you can reset the password with a few clicks.
This method is convenient and efficient. After you have created an ECS, you are advised to log in to it and install the password reset plug-ins.
- The password reset plug-ins have been installed on the ECSs created using a public image by default. To check the plug-ins installation, see 1.
Notes
- The one-click password reset plug-ins apply only to ECSs.
- You can determine whether to install the password reset plug-ins.
- After the installation, do not uninstall the plug-ins by yourself. Otherwise, the ECS password cannot be reset.
- After you reinstall or change the OS of an ECS, the one-click password reset function will become invalid. If you want to continue using this function, reinstall password reset plug-ins.
- After you replace the system disk of an ECS, the one-click password reset function will become invalid. If you want to continue using this function, reinstall password reset plug-ins.
- Password reset plug-ins cannot be installed on a CoreOS ECS.
- If one-click password reset plug-ins have not been installed before the ECS password is forgotten or expired, the plug-ins cannot be used to reset the ECS password.
- One-click password reset plug-ins can automatically update only after an EIP is bound to the ECS.
- CloudResetPwdAgent has been open-sourced in the GitHub open-source platform according to GNU General Public License v2.0.
Prerequisites
- The available space in drive C of a Windows ECS is greater than 300 MB, and data can be written to it.
The available space in root directory of a Linux ECS is greater than 300 MB, and data can be written to it.
- One-click password reset can be used on the ECSs created using SUSE 11 SP4 only if their memory capacity is greater than or equal to 4 GB.
- DHCP is enabled in the VPC to which the ECS belongs.
- The ECS network connectivity is normal.
- The ECS security group rule in the outbound direction meets the following requirements:
- Protocol: TCP
- Port Range: 80
- Remote End: 169.254.0.0/16
If you use the default outbound security group rule, the preceding requirements are met, and the ECS can be initialized. Default security group rules in the outbound direction are as follows:
- Protocol: ANY
- Port Range: ANY
- Remote End: 0.0.0.0/16
Installing Password Reset Plug-ins on a Linux ECS
- Use either of the following methods to check whether the password reset plug-ins have been installed on the ECS:
Method 1: Use the management console for query.
- Log in to the management console.
- Under Computing, click Elastic Cloud Server.
- Locate the row containing the target ECS, click More in the Operation column, and select Reset Password from the drop-down list.
- If a dialog box is displayed, asking you to enter the new password, the password reset plug-ins have been installed. No further action is required.
Figure 1 Information displayed if the password reset plug-ins have been installed
- If a dialog box is displayed, asking you to download a password reset script, the password reset plug-ins have not been installed. Then, install them.
Figure 2 Information displayed if the password reset plug-ins have not been installed
- If a dialog box is displayed, asking you to enter the new password, the password reset plug-ins have been installed. No further action is required.
Method 2: Use the ECS for query.- Log in to the ECS as user root.
- Run the following command to check whether CloudResetPwdAgent and CloudResetPwdUpdateAgent have been installed:
Check whether the obtained information is similar to that shown in Figure 3.
- If yes, the plug-ins have been installed.
- If no, the plug-ins have not been installed. Then, install them.
- Download the one-click password reset plug-in CloudResetPwdAgent.zip according to your OS, 32bit or 64bit.
There is no special requirement for the directory that stores CloudResetPwdAgent.zip. Customize the directory.
- For the 32bit OS, run the following command:
wget http://cn-south-1-cloud-reset-pwd.obs.cn-south-1.myhuaweicloud.com/linux/32/reset_pwd_agent/CloudResetPwdAgent.zip
Download path: https://cn-south-1-cloud-reset-pwd.obs.cn-south-1.myhuaweicloud.com/linux/32/reset_pwd_agent/CloudResetPwdAgent.zip
- For the 64bit OS, run the following command:
wget http://cn-south-1-cloud-reset-pwd.obs.cn-south-1.myhuaweicloud.com/linux/64/reset_pwd_agent/CloudResetPwdAgent.zip
Download path: https://cn-south-1-cloud-reset-pwd.obs.cn-south-1.myhuaweicloud.com/linux/64/reset_pwd_agent/CloudResetPwdAgent.zip
- For the 32bit OS, run the following command:
- Run the following command to decompress CloudResetPwdAgent.zip:
There is no special requirement for the directory that stores the decompressed CloudResetPwdAgent.zip. Customize the directory.
unzip -o -d Decompressed directory CloudResetPwdAgent.zip
An example is provided as follows:
If the decompressed directory is /home/linux/test, run the following command:
unzip -o -d /home/linux/test CloudResetPwdAgent.zip
- Install the one-click password reset plug-ins.
- Run the following command to open the CloudResetPwdUpdateAgent.Linux file:
cd CloudResetPwdAgent/CloudResetPwdUpdateAgent.Linux
- Run the following command to add the execute permission for the setup.sh file:
chmod +x setup.sh
- Run the following command to install the plug-ins:
- Run the following commands to check whether the installation is successful:
service cloudResetPwdAgent status
service cloudResetPwdUpdateAgent status
If the status of CloudResetPwdAgent and CloudResetPwdUpdateAgent is not unrecognized service, the installation is successful. Otherwise, the installation failed.
- You can also check whether the password reset plug-ins have been installed using the methods provided in 1.
- If the installation failed, check whether the installation environment meets requirements and install the plug-ins again.
- Run the following command to open the CloudResetPwdUpdateAgent.Linux file:
Installing Password Reset Plug-ins on a Windows ECS
- Log in to the ECS.
- Check whether password reset plug-ins CloudResetPwdAgent and CloudResetPwdUpdateAgent have been installed on the ECS. To check this, perform the following operations:
Start the Task Manager and check whether cloudResetPwdAgent and cloudResetPwdUpdateAgent are displayed on the Services tab.
- If yes, no further action is required.
- If no, go to 3.
- Download package CloudResetPwdAgent.zip.
There is no special requirement for the directory that stores CloudResetPwdAgent.zip. Customize the directory.
Download path: https://cn-south-1-cloud-reset-pwd.obs.cn-south-1.myhuaweicloud.com/windows/reset_pwd_agent/CloudResetPwdAgent.zip
- Decompress CloudResetPwdAgent.zip.
There is no special requirement for the directory that stores the decompressed CloudResetPwdAgent.zip. Customize the directory.
- Install the plug-ins.
- Double-click setup.bat in both CloudResetPwdAgent.Windows and CloudResetPwdUpdateAgent.Windows.
The password reset plug-ins start to be installed.
- View the Task Manager and check whether the installation is successful.
If cloudResetPwdAgent and cloudResetPwdUpdateAgent are displayed in the Task Manager, as shown in Figure 4, the installation is successful. Otherwise, the installation failed.
If the installation failed, check whether the installation environment meets requirements and install the plug-ins again.
- Double-click setup.bat in both CloudResetPwdAgent.Windows and CloudResetPwdUpdateAgent.Windows.
Follow-up Procedure
- After the one-click password reset plug-ins are installed, you can add them to the startup items if they cannot automatically start upon ECS startup. For details, see What Can I Do If One-Click Password Reset Plug-in Fails to Start?
- After installing the one-click password reset plug-ins, do not delete the CloudResetPwdAgent or CloudResetPwdUpdateAgent process. Otherwise, one-click password reset will not be available.
- One-click password reset plug-ins have been upgraded. New ECSs work in PIPE mode by default, preventing the plug-ins from using service ports. Existing ECSs still work in AUTO mode, in which the plug-ins randomly use a service port ranging from 31,000 to 32,999. The system will automatically select an idle port with the smallest port number.
Updating the Plug-ins
You do not need to pay special attention to the plug-in updating because the system will automatically update them.
Uninstalling the Plug-ins
If you do not need the password reset function anymore, perform the following operations to uninstall the plug-ins:
- Linux
- Log in to the ECS.
- Run the following commands to switch to the bin directory and delete cloudResetPwdAgent:
cd /CloudrResetPwdAgent/bin
sudo ./cloudResetPwdAgent.script remove
- Run the following commands to switch to the bin directory and delete cloudResetPwdUpdateAgent:
cd /CloudResetPwdUpdateAgent/bin
sudo ./cloudResetPwdUpdateAgent.script remove
- Run the following commands to delete the plug-ins:
sudo rm -rf /CloudrResetPwdAgent
sudo rm -rf /CloudResetPwdUpdateAgent
- Windows
- Switch to the C:\CloudResetPwdUpdateAgent\bin folder.
- Double-click UninstallApp-NT.bat.
- Delete the file in C:\CloudResetPwdUpdateAgent.
- Switch to the C:\CloudResetPwdAgent\bin folder.
- Double-click UninstallApp-NT.bat.
- Delete the file in C:\CloudResetPwdAgent.
Last Article: Creating a Key Pair
Next Article: Obtaining the Password for Logging In to a Windows ECS


Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.