• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. User Guide
  4. Passwords and Key Pairs
  5. Resetting the Password for Logging In to an ECS
  6. Resetting the Password for Logging In to a Windows ECS

Resetting the Password for Logging In to a Windows ECS

Prerequisites

  • A temporary Linux ECS which runs Ubuntu 14.04 or later and locates in the same AZ as the target ECS is available.
  • You have bound an EIP to the temporary ECS and configured the apt-get source.
  • You have used either of the following methods to install ntfs-3g and chntpw software packages on the temporary ECS:

    Method 1:

    Run the following command to install the ntfs-3g and chntpw software packages:

    sudo apt-get install ntfs-3g chntpw

    Method 2:

    Download the desired ntfs-3g and chntpw software packages according to the temporary ECS OS. For detailed installation and use guide, see the NTFS official website and chntpw official website.

    Log in at www.tuxera.com/community/open-source-ntfs-3g/ to obtain the ntfs-3g software package.

    Log in at https://pkgs.org/download/chntpw to obtain the chntpw software package.

Procedure

  1. Stop the original ECS, detach the system disk from it, and attach the system disk to the temporary ECS.
    1. Log in to the management console.
    2. Click in the upper left corner and select the desired region and project.
    3. Under Computing, click Elastic Cloud Server.
    4. Stop the original Windows ECS, switch to the page providing details about the ECS, and click the Disks tab.
      NOTE:

      Do not forcibly stop the Windows ECS. Otherwise, password reset may fail.

    5. Locate the row containing the system disk and click Detach to detach the system disk from the ECS.
    6. On the page providing details about the temporary ECS, click the Disks tab.
    7. Click Attach Disk. In the displayed dialog box, select the system disk detached in step 1.e and attach it to the temporary ECS.
  2. Log in to the temporary ECS remotely and attach the system disk.
    1. Run the following command to view the directory of the system disk detached from the original Windows ECS now attached to the temporary ECS:

      fdisk -l

    2. Run the following command to mount the file system of the detached system disk to the temporary ECS:

      mount -t ntfs-3g /dev/Result obtained in step 2.a /mnt/

      For example, if the query result obtained in step 2.a is xvde2, run the following command:

      mount -t ntfs-3g /dev/xvde2 /mnt/

  3. Change the password and clear the original password.
    1. Run the following command to back up the SAM file:

      cp /mnt/Windows/System32/config/SAM /mnt/Windows/System32/config/SAM.bak

    2. Run the following command to change the password of a specified user:

      chntpw -u Administrator /mnt/Windows/System32/config/SAM

    3. Enter 1q, and y as prompted, and press Enter

      The password has been reset if the following information is displayed:

      Select: [q] > 1
      Password cleared!
      
      Hives that have changed:
      #Name
      0<SAM>
      Write hive files? (y/n) [n] : y
      0<SAM> - OK
  4. Stop the temporary ECS, detach the system disk, and attach the system disk to the original Windows ECS.
    1. Stop the temporary ECS, switch to the page providing details about the ECS, and click the Disks tab.
    2. Click Detach to detach the data disk temporarily attached in step 1.g.
    3. On the page providing details about the original Windows ECS, click the Disks tab.
    4. Click Attach Disk. In the displayed dialog box, select the data disk detached in step 4.b and device name /dev/sda.
  5. Start the original Windows ECS and set a new login password.
    1. Click Start to start the original Windows ECS. After the status becomes Running, click Remote Login in the Operation column.
    2. Click Start. Enter CMD in the search box and press Enter.
    3. Run the following command to change the password (the new password must meet the requirements described in Table 1):

      net user Administrator New password