Join the 85,000 open source advocates who receive our giveaway alerts and article roundups.
How to reset a Windows password with Linux
How to reset a Windows password with Linux
Lost your Windows login? The chntpw utility can save the day.

Opensource.com. CC BY-SA 4.0
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.
chntpw.
1. Attach the Live USB to your PC and restart from the login screen, as shown below:
2. Boot from the Live USB and click on Try Fedora:
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:
4. Install the chntpw utility with the following command (you'll need a live internet connection for this):
sudo dnf install -y chntpw
5. Check which partition should be mounted by sfdisk -l ...:
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/
Also, check the user records in the Security Account Manager (SAM) database:
6. Edit the SAM database with the command:
sudo chntpw -i SAMThen type 1 (for Edit user data and passwords):
And type your user account name (i.e., Archit-PC in this example) for the username:
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:
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:
That's all there is to it! I hope this will be helpful if you ever need to reset a Windows password.

















22 Comments
It really worked
Glad to hear that!
Spotted a small glitch. Looks like the screenshot that supposed to illustrate the execution of a mounting command, sudo mount /dev/sda2 /mnt/Microsoft/, is wrong. For me it shows the result of the execution of a chntpw command, sudo chntpw -i SAM.
Oh that's correct, thanks for finding it!! :)
Archit, If you send over a revised screenshot, I can swap it out.
Thanks a lot Rikki, i’ve sent the revision :)
While I love Fedora clonezillia has chntpw already there.
I have clonezilla on my pxe boot arsenal.
Great, I got to give it a try!
This is great! Thanks for sharing. I have used Linux to rescue a number of crashed/trashed Windows computers. This is the most complete description I have ever seen of how to use chntpw.
Glad to hear that!! :-)😊
Superb beginning of the day :) thanks for this post :+1
Happy to serve :)
"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:
passwordreset_root.png
Logging in as root
4. Install the chntpw utility with the following command (you'll need a live internet connection for this):
sudo dnf install -y chntpw"
You are saying log in as root. You don't need sudo if you are already root.
Thanks John, that’s correct. I used this command so that a person using live-user can also execute it without any modifications, hope this makes sense. :)
Thanks for sharing! I have used chntpw for years. This utility can also run from Ubuntu Live CD.
There are also other free alternatives that can break a lost windows password. For instance, using Ophcrack or a Windows install disk:
http://ophcrack.sourceforge.net/
https://www.top-password.com/blog/reset-windows-10-password-with-sticky-...
Oh cool, thanks for sharing, will definitely try these out! :)
Thanks for the tip, might come handy! BTW you don't need to use sudo if you're already working as root.
Thanks :)
Nice Work
Thank you!
Wow! Didn't know about this. Nice article!
Bookmarked...
Thank you! :)