Help Center> Bare Metal Server> User Guide> Key Pair and Password> (Optional) Installing the One-Click Password Reset Plug-in

(Optional) 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 password reset plugins.

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 plugin.
  3. After installing the plug-in, do not uninstall it. Otherwise, the management console may fail to reset the password.
  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, and the BMS can be initialized. 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 target 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 and CloudResetPwdUpdateAgent are installed:

      ls -lh /Cloud*

      Figure 3 Checking whether the password reset plug-in is installed

      Check whether the information is similar to that shown in Figure 3.

      • If yes, the plugin has been installed. No further action is required.
      • If no, the plug-in has not been installed. Perform subsequent operations.

  2. Download the one-click password reset plug-in CloudResetPwdAgent.zip.

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

    wget https://cn-south-1-cloud-reset-pwd.obs.cn-south-1.myhuaweicloud.com/linux/64/reset_pwd_agent/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. Customize the directory.

    unzip -o -d Plug-in decompression directory CloudResetPwdAgent.zip

    Example:

    If the decompressed directory is /home/linux/test, run the following command:

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

  4. Install password reset plugins CloudResetPwdAgent and CloudResetPwdUpdateAgent.

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

      cd /home/linux/test/CloudResetPwdAgent/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 plugins:

      sudo sh setup.sh

    4. Run the following commands to check whether the installation is successful:

      service cloudResetPwdUpdateAgent status

      If the status of CoudResetPwdUpdateAgent is running, plugin installation is successful. Otherwise, the installation fails.

      You can also check whether the password reset plug-in is installed successfully based on 1.

      If the installation fails, check whether the installation environment meets requirements and install the plugin again.

Install the Password Reset Plug-in on a Windows BMS

  1. Check whether CloudResetPwdAgent and CloudResetPwdUpdateAgent have been installed on the BMS. 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 Successful plug-in installation
    • If yes, no further action is required.
    • If no, go to the next step.

  2. Download the one-click password reset plug-in 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

  3. Decompress CloudResetPwdAgent.zip.

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

  4. Install password reset plugins CloudResetPwdAgent and CloudResetPwdUpdateAgent.

    1. Double-click setup.bat in both the CloudResetPwdAgent.Windows and CloudResetPwdUpdateAgent.Windows folders.
    2. View the Task Manager to check whether the installation is successful.

      If you can find cloudResetPwdAgent and cloudResetPwdUpdateAgent in the Task Manager, the installation is successful. Otherwise, the installation fails.

      If the installation fails, check whether the installation environment meets requirements and install the plugin 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 BMSs

    Log in to the BMS as user root and run the following commands:

    1. sudo bash /CloudrResetPwdAgent/bin/cloudResetPwdAgent.script remove
    2. sudo bash /CloudResetPwdUpdateAgent/bin/cloudResetPwdUpdateAgent.script remove
    3. sudo rm -rf /CloudrResetPwdAgent
    4. sudo rm -rf /CloudResetPwdUpdateAgent
  • Windows BMSs
    1. Log in to the BMS and go to the C:\CloudResetPwdUpdateAgent\bin directory.
    2. Double-click UninstallApp-NT.bat.
    3. Delete C:\CloudResetPwdUpdateAgent.
    4. Go to the C:\CloudResetPwdAgent\bin directory.
    5. Double-click UninstallApp-NT.bat.
    6. Delete C:\CloudResetPwdAgent.