chntpw is a command-line utility in Linux that is used to reset the password of a user account in the Windows NT, 2000, XP, Vista, and Windows 7 operating systems. It allows you to reset the password of a user account even if you do not know the current password, which can be useful if you have forgotten your password or if you are trying to recover access to a user account that has been compromised.
To use chntpw, you will need to boot your system from a live Linux distribution, such as a live USB or DVD. You can then mount the Windows partition and navigate to the Windows/System32/config directory, where the user account information is stored.
Once you are in the config directory, you can use the following command syntax to reset the password of a user account:
# chntpw [options] /path/to/sam_file
This command will open the SAM file, which contains the user account information for the Windows system, and allow you to reset the password of a specific user account.
If you encounter the below error while running the command chntpw:
chntpw: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install chntpw |
Ubuntu | apt-get install chntpw |
Alpine | apk add chntpw |
Arch Linux | pacman -S chntpw |
Kali Linux | apt-get install chntpw |
Fedora | dnf install chntpw |
Raspbian | apt-get install chntpw |
chntpw includes several options that allow you to customize the way it resets the password. For example, you can use the -u option to specify the username of the account that you want to modify, and the -l option to list all the user accounts in the system.
For example, to reset the password of the user john to password, you can use the following command:
# chntpw -u john /path/to/sam_file
chntpw Command Examples
1. List all users in the SAM file:
# chntpw -l /path/to/sam_file
2. Edit [u]ser interactively:
# chntpw -u username /path/to/sam_file
3. Use chntpw [i]nteractively:
# chntpw -i /path/to/sam_file