If you (or someone you know) ever forget your Windows password, you'll be glad to know about chntpw, a neat Linux utility that you can use to reset a Windows password. For this how-to, I created a Windows virtual machine and set the password to pass123 on my user account, Archit-PC. I also created a Live USB with Fedora 27 using the Fedora Media Writer application.

Here are the steps, along with screenshots, to guide you through the quick and super easy process of resetting your Windows password with chntpw.

1. Attach the Live USB to your PC and restart from the login screen, as shown below:

Windows login screen

opensource.com

2. Boot from the Live USB and click on Try Fedora:

Booting into Fedora

opensource.com

Fedora install screen

opensource.com

3. Log out from live-user and log into root. This step is not necessary, but I prefer to use the root user to bypass any permission issues:

Logging in as root

opensource.com

4. Install the chntpw utility with the following command (you'll need a live internet connection for this):

sudo dnf install -y chntpw

Installing chntpw

opensource.com

5. Check which partition should be mounted by sfdisk -l ...:

Checking which partition to load with sfdisk

opensource.com

and mount that partition (e.g., /dev/sda2) with the following command:

sudo mount /dev/sda2 /mnt/Microsoft/

outpust screenshot: sudo mount /dev/sda2 /mnt/Microsoft/

Change the current directory to the config directory:

cd /mnt/Microsoft/Windows/System32/config/

Changing to config

opensource.com

Also, check the user records in the Security Account Manager (SAM) database:

Checking SAM database

opensource.com

6. Edit the SAM database with the command:

sudo chntpw -i SAM

Then type 1 (for Edit user data and passwords):

Select 1 for Edit user data and passwords

opensource.com

And type your user account name (i.e., Archit-PC in this example) for the username:

Enter your username

opensource.com

7. Type 1 to clear the user password or 2 to set a new password for the Archit-PC user, then quit and save the changes:

Edit user menu

opensource.com

Confirmation that password was cleared

opensource.com

8. Reboot to Windows. If you selected 1 above, you'll see there's no password required to log in. Just click Sign in and you will be logged in:

Windows login screen

opensource.com

Logged into Windows

opensource.com

That's all there is to it! I hope this will be helpful if you ever need to reset a Windows password.

Logo

更多推荐