Reset Windows 7 Password With Ubuntu

Sometimes you forget your Windows password, or maybe a workmate leaves and you replace them but cannot access their old computer because it has a password. You cannot guess their password to log in. And you cannot reinstall Windows because it has a lot of important data and software that would need to be reinstalled and tweaked. So reinstalling Windows is not the answer.

If you have this problem, don’t worry — you can still reset a Windows 7 password using Ubuntu, whether booting it from USB or using an Ubuntu live CD. To reset a Windows 7 password using Ubuntu you can use chntpw.

To install chntpw on Ubuntu, follow the steps below:

1. Open your terminal and add the universe repository by editing sources.list:

vim /etc/apt/sources.list

and add or enable these lines:

deb http://archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse

2. Update your repository list:

apt-get update

3. Install chntpw:

apt-get install chntpw

4. chntpw is now installed.

Note: chntpw only works on 32-bit OS versions. For 64-bit you need to download from the Debian source here and pick the 64-bit version.

chntpw usage:

1. Get your hard drive label by using:

fdisk -l

2. Find where you installed your Windows 7, then go to that hard drive and the Windows installation folder:

cd /media//WINDOWS/system32/config/

3. Use chntpw to reset the password:

chntpw SAM

4. It will show you user details and commands to reset the password:

chnptw1

Choose “1” to clear the default user password and press “y” to confirm.

chnptw2

5. You are done. Reboot to your Windows and there is no password anymore. You can set the password from Windows again if you want.

Note: to reset the password for a user other than the administrator or default user, use this command:

chntpw -u <username> SAM