Help Center> Image Management Service> User Guide (Ankara Region)> Linux Operations> Installing the One-Click Password Reset Plug-In
Updated on 2024-04-15 GMT+08:00

Installing the One-Click Password Reset Plug-In

Scenarios

You are advised to install the password reset plug-in CloudResetPwdAgent before creating a private image. In this way, you can reset the password of ECSs created from the image by a few clicks.

  • ECSs created from a public image have this plug-in installed by default.
  • For ECSs created from an external image file, install the plug-in by performing the operations in this section.

The installation of this plug-in is optional. If you want to use the one-click password resetting function on the management console, install the plug-in by following the instructions provided in this section.

Precautions

  • You can decide whether to install the CloudResetPwdAgent plug-in.
  • Not all OSs support the one-click password reset plug-in. Table 1 lists the OSs that support this plug-in.
    Table 1 OSs that support the one-click password reset plug-in

    OS Type

    OS Version

    CentOS

    CentOS 8.3 64bit

    CentOS 8.2 64bit

    CentOS 8.1 64bit

    CentOS 8.0 64bit

    CentOS 7.3 64bit

    CentOS 7.2 64bit

    CentOS 7.0 64bit

    CentOS 7.1 64bit

    CentOS 6.9 64bit

    CentOS 6.8 64bit

    CentOS 6.8 32bit

    CentOS 6.6 32bit

    CentOS 6.6 64bit

    CentOS 6.5 64bit

    CentOS 6.4 64bit

    CentOS 6.3 64bit

    NOTE:

    For CentOS 8, disable SELinux before you install the one-click password reset plug-in. After the plug-in is installed, you can determine whether to enable SELinux as needed.

    Debian

    Debian 9.0 64bit

    Debian 8.8 64bit

    Debian 8.2 64bit

    Debian 7.5 64bit

    Debian 7.5 32bit

    openSUSE

    openSUSE 42.2 64bit

    openSUSE 13.2 64bit

    openSUSE Leap 42.2 64bit

    openSUSE Leap 42.1 64bit

    SUSE

    SUSE 12 SP2 64bit

    SUSE 12 SP1 64bit

    SUSE 11 SP4 64bit

    Ubuntu

    Ubuntu 16.10 32bit

    Ubuntu 16.04 32bit

    Ubuntu Server 16.04 64bit

    Ubuntu Server 14.04 64bit

    Ubuntu Server 14.04 32bit

    EulerOS

    EulerOS 2.2 64bit

    Fedora

    Fedora 25 64bit

    Fedora 24 64bit

    Oracle Linux

    Oracle Linux 7.3 64bit

    Oracle Linux 6.9 64bit

    Oracle Linux 6.5 64bit

Prerequisites

  • The ECS status is Running.
  • The ECS must have a remaining space of more than 300 MB, and data can be written to its root directory.
  • SELinux affects the password reset plug-in of Linux ECSs. You can disable it by referring to "Disabling SELinux" in Elastic Cloud Server User Guide.
  • ECSs created using a SUSE 11 SP4 image must have 4 GB or a larger memory.
  • DHCP must be enabled for the VPC used by the ECS.
  • Networks of the ECS are normal.
  • The outbound security group rule of the ECS must 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, preceding requirements can be met, and the ECS can be initialized. The default outbound security group rule is as follows:

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

Procedure

  1. Use either of the following methods to check whether the password reset plug-in has been installed on the ECS:

    Method 1: Use the management console for query.

    1. Log in to the management console.
    2. Under Computing, 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-in has been installed. No further action is required.
      • If a dialog box is displayed, asking you to download a password reset script, the password reset plug-in has not been installed. Then, install it.
    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 has been installed:

      ls -lh /Cloud*

      Figure 1 Checking whether the plug-in has been installed

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

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

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

    Contact the administrator to obtain the path of the OBS bucket from which the plug-in will be downloaded.

    For example, the download path is http://xxx-cloud-reset-pwd.obs.com/linux/64/reset_pwd_agent/CloudResetPwdAgent.zip.

    Run the following command to download the plug-in:

    wget http://xxx-cloud-reset-pwd.obs.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. Use any directory.

    unzip -o -d Decompressed directory CloudResetPwdAgent.zip

    An example is provided as follows:

    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 the requirements and install the plug-in again.

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

    chmod 700 /CloudrResetPwdAgent/bin/cloudResetPwdAgent.script

    chmod 700 /CloudrResetPwdAgent/bin/wrapper

    chmod 600 /CloudrResetPwdAgent/lib/*