You can reset your ECS password if:
The method described in this section can only be used to change the password of a local Windows account; it cannot be used to change a domain account password.
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 ntfs-3g and chntpw software packages of the version required by the temporary ECS OS and install them.
in the upper left corner and select a region and project.
Do not forcibly stop the Windows ECS. Otherwise, password reset may fail.
fdisk -l
mount -t ntfs-3g /dev/<system-disk-directory> /mnt/
For example, if the queried system disk directory is xvde2, run the following command:
mount -t ntfs-3g /dev/xvde2 /mnt/
If the error information below is returned in the command output, the NTFS file systems between the original Windows ECS and the Linux ECS may be inconsistent.
The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/xvde2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.
If the file system is inconsistent, back up the disk data first, and run the following command to repair the New Technology File System (NTFS) partition, and then attach the system disk:
ntfsfix /dev/system-disk-directory
For example, if the queried system disk directory is xvde2, run the following command:
ntfsfix /dev/xvde2
cp /mnt/Windows/System32/config/SAM /mnt/Windows/System32/config/SAM.bak
The password has been reset if the following information is displayed:
Select: [q] > 1 Password cleared! Select: [q] > q Hives that have changed: #Name 0<SAM> Write hive files? (y/n) [n] : y 0<SAM> - OK
net user Administrator <new-password>