Help Center > > User Guide> Passwords and Key Pairs> (Optional) Installing One-Click Password Reset Plug-ins

(Optional) Installing One-Click Password Reset Plug-ins

Updated at: Sep 02, 2021 GMT+08:00

The public cloud platform provides the password reset function. If the password of your ECS is forgotten or expires and your ECS has 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, it is a good practice to log in to it and install the password reset plug-ins.

  • If your ECS was created using a public image, the password reset plug-ins were installed on the ECS by default. To check whether the plug-ins were installed, see 1.

Notes

  1. The one-click password reset plug-ins apply only to ECSs.
  2. You can determine whether to install the password reset plug-ins.
  3. After the installation, do not uninstall the plug-ins by yourself. Otherwise, the ECS password cannot be reset.
  4. 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.
  5. 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.
  6. Password reset plug-ins cannot be installed on a CoreOS ECS.
  7. 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.
  8. One-click password reset plug-ins can automatically update only after an EIP is bound to the ECS.
  9. 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 the 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 GiB.
  • 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 security group rules for the outbound direction, the preceding requirements are met, and the ECS can be initialized. The default security group rules for 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

  1. 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.

    1. Log in to the management console.
    2. Under Compute, click Elastic Cloud Server.
    3. 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
    Method 2: Use the ECS for query.
    1. Log in to the ECS as user root.
    2. Run the following command to check whether CloudResetPwdAgent and CloudResetPwdUpdateAgent have been installed:

      ls -lh /Cloud*

      Figure 3 Checking whether the plug-ins 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.

  2. 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. Use any directory.

  3. Run the following command to decompress CloudResetPwdAgent.zip:

    There is no special requirement for the directory that stores the decompressed CloudResetPwdAgent.zip. Use any 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

  4. Install the one-click password reset plug-ins.

    1. Run the following command to open the CloudResetPwdUpdateAgent.Linux file:

      cd CloudResetPwdAgent/CloudResetPwdUpdateAgent.Linux

    2. Run the following command to add the execute permission for the setup.sh file:

      chmod +x setup.sh

    3. Run the following command to install the plug-ins:

      sudo sh setup.sh

    4. 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.

  5. Modify the file permission of the password reset plug-in.

    chmod 640 /CloudrResetPwdAgent/logs/resetPwdAgent.log

    chmod 640 /CloudrResetPwdAgent/logs/wrapper.log

    chmod 750 /CloudrResetPwdAgent/bin/cloudResetPwdAgent.script

    chmod 700 /CloudrResetPwdAgent/bin/wrapper

    chmod 600 /CloudrResetPwdAgent/lib/commons-codec-1.14.jar

    chmod 600 /CloudrResetPwdAgent/lib/libwrapper.so

    chmod 600 /CloudrResetPwdAgent/lib/resetpwdagent.jar

    chmod 600 /CloudrResetPwdAgent/lib/wrapper.jar

    chmod 640 /CloudrResetPwdAgent/lib/json-20160810.jar

    chmod 640 /CloudrResetPwdAgent/lib/log4j-api-2.8.2.jar

    chmod 640 /CloudrResetPwdAgent/lib/log4j-core-2.8.2.jar

Installing Password Reset Plug-ins on a Windows ECS

  1. Log in to the ECS.
  2. 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 page.

    Figure 4 Windows Task Manager
    • If yes, no further action is required.
    • If no, go to 3.

  3. Download package CloudResetPwdAgent.zip.

    There is no special requirement for the directory that stores CloudResetPwdAgent.zip. Use any directory.

    Download path: https://ap-southeast-1-cloud-reset-pwd.obs.ap-southeast-1.myhuaweicloud.com/windows/reset_pwd_agent/CloudResetPwdAgent.zip

  4. Decompress CloudResetPwdAgent.zip.

    There is no special requirement for the directory that stores the decompressed CloudResetPwdAgent.zip. Use any directory.

  5. Install the plug-ins.

    1. Double-click setup.bat in both CloudResetPwdAgent.Windows and CloudResetPwdUpdateAgent.Windows.

      The password reset plug-ins start to be installed.

    2. 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.

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
    1. Log in to the ECS.
    2. Run the following commands to switch to the bin directory and delete cloudResetPwdAgent:

      cd /CloudrResetPwdAgent/bin

      sudo ./cloudResetPwdAgent.script remove

    3. Run the following commands to switch to the bin directory and delete cloudResetPwdUpdateAgent:

      cd /CloudResetPwdUpdateAgent/bin

      sudo ./cloudResetPwdUpdateAgent.script stop

      sudo ./cloudResetPwdUpdateAgent.script remove

    4. Run the following commands to delete the plug-ins:

      sudo rm -rf /CloudrResetPwdAgent

      sudo rm -rf /CloudResetPwdUpdateAgent

  • Windows
    1. Switch to the C:\CloudResetPwdUpdateAgent\bin folder.
    2. Double-click UninstallApp-NT.bat.
    3. Delete the file in C:\CloudResetPwdUpdateAgent.
    4. Switch to the C:\CloudResetPwdAgent\bin folder.
    5. Double-click UninstallApp-NT.bat.
    6. Delete the file in C:\CloudResetPwdAgent.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel