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:

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

opensource.com

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:

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

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

opensource.com
and mount that partition (e.g., /dev/sda2
) with the following command:
sudo mount /dev/sda2 /mnt/Microsoft/

Change the current directory to the config
directory:
cd /mnt/Microsoft/Windows/System32/config/

opensource.com
Also, check the user records in the Security Account Manager (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
):

opensource.com
And type your user account name (i.e., Archit-PC
in this example) for the 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:

opensource.com

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:

opensource.com

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