Help Center/ Bare Metal Server/ User Guide/ Key Pair and Password/ Installing the One-Click Password Reset Plug-in
Updated on 2024-07-22 GMT+08:00

Installing the One-Click Password Reset Plug-in

Scenarios

If the password of your BMS is lost or expires and your BMS has the password reset plug-in CloudResetPwdAgent installed, you can reset the password by a few clicks.

This method is convenient and efficient. After you have created a BMS, you are advised to log in to it and install the one-click password reset plug-in.

By default, the one-click password reset plug-in has been installed on the BMSs created using public images. To check whether the plug-in has been installed for the BMS, see step 1 in "Install the Password Reset Plug-ins on a Linux BMS" or step 1 in "Install the Password Reset Plug-ins on a Windows BMS".

Notes

  1. Do not use any other password reset plug-in.
  2. It is up to you to decide whether to install the CloudResetPwdAgent plug-in.
  3. After installing the plug-in, do not uninstall it. Otherwise, you may fail to reset the password on the management console.
  4. After you reinstall or change the BMS OS, the one-click password resetting function will become invalid. If you still want to use this function, reinstall the CloudResetPwdAgent plug-in.
  5. CloudResetPwdAgent can be automatically upgraded only if an EIP is bound to the BMS. You can also download the upgrade package and upgrade CloudResetPwdAgent manually.

Prerequisites

  • The BMS must be in Running state.
  • A Windows BMS must have larger than 600 MB remaining space and data can be written to its drive C.

    A Linux BMS must have larger than 600 MB remaining space and data can be written to its root directory.

  • Ensure that DHCP is enabled in the VPC to which the BMS belongs.
  • The BMS network connectivity is normal.
  • Ensure that security group rules in the outbound direction meet 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. The default outbound security group rule is as follows:

    • Protocol: ANY
    • Port Range: ANY
    • Remote End: 0.0.0.0/16

Install the Password Reset Plug-in on a Linux BMS

  1. Use either of the following methods to check whether the password reset plug-in is installed on the BMS:

    Method 1: Use the management console.

    1. Log in to the management console.
    2. Under Computing, click Bare Metal Server.

      The BMS console is displayed.

    3. Locate the row that contains the BMS, click More in the Operation column, and select Reset Password from the drop-down list.
      • If the dialog box shown in Figure 1 is displayed, the password reset plug-in is installed. No further action is required.
        Figure 1 Information displayed if the password reset plug-in is installed
      • If the dialog box shown in Figure 2 is displayed, the password reset plug-in is not installed. Perform subsequent operations to install it.
        Figure 2 Information displayed if the password reset plug-in is not installed

    Method 2: Log in to the OS.

    1. Log in to the BMS as user root.
    2. Run the following command to check whether CloudResetPwdAgent has been installed:

      ls -lh /Cloud*

      Figure 3 Checking whether the plug-in has been installed

      Check whether information similar to Figure 3 is displayed.

      • If yes, the plugin has been installed.
      • If no, the plug-in has not been installed. Then, install it.

  2. Download the plug-in package CloudResetPwdAgent.zip and verify its integrity by referring to Obtain the One-Click Password Reset Plug-In and Verifying Its Integrity (Linux).

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

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

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

    unzip -o -d Decompressed directory CloudResetPwdAgent.zip

    Example:

    If the plug-in is decompressed to /home/linux/test, run the following command:

    unzip -o -d /home/linux/test CloudResetPwdAgent.zip

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

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

      cd CloudResetPwdAgent/CloudResetPwdAgent.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-in:

      sudo sh setup.sh

      If "cloudResetPwdAgent install successfully." is displayed and "Failed to start service cloudResetPwdAgent" is not displayed, the installation is successful.
      • You can also check whether the plug-in has been installed using the methods provided in 1.
      • If the installation failed, check whether the installation environment meets requirements and install the plug-in again.

  5. Modify file permissions for the password reset plug-in.

    chmod 700 /CloudrResetPwdAgent/bin/cloudResetPwdAgent.script

    chmod 700 /CloudrResetPwdAgent/bin/wrapper

    chmod 600 /CloudrResetPwdAgent/lib/*

Install the Password Reset Plug-in on a Windows BMS

  1. Check whether CloudResetPwdAgent has been installed on the BMS. To check this, perform the following operations:

    Start the Task Manager and check whether cloudResetPwdAgent is displayed on the Services tab page.

    Figure 4 Successful plug-in installation
    • If yes, no further action is required.
    • If no, go to the next step.

  2. Download the plug-in package CloudResetPwdAgent.zip and verify its integrity by referring to Obtain the One-Click Password Reset Plug-In and Verifying Its Integrity (Windows).

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

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

  3. Decompress CloudResetPwdAgent.zip.

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

  4. Install the plug-in.

    1. Double-click setup.bat in CloudResetPwdAgent.Windows.

      The password reset plug-in starts to be installed.

    2. View the Task Manager to check whether the installation is successful.

      If cloudResetPwdAgent is displayed in the Task Manager, as shown in Figure 5, the installation is successful. Otherwise, the installation failed.

      Figure 5 Successful plug-in installation

      If the installation failed, check whether the installation environment meets requirements and install the plug-in again.

Uninstall the Password Reset Plug-in

If you do not need the password reset function any longer, perform the following operations to uninstall the plug-in:

  • Linux
    1. Log in to the BMS.
    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 command to delete the plug-in:

      sudo rm -rf /CloudrResetPwdAgent

      Check whether CloudResetPwdUpdateAgent exists. If it exists, run the following command to delete it:

      sudo rm -rf /CloudResetPwdUpdateAgent

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