• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

chntpw : command not found

by Deepika

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

Filed Under: Linux

Some more articles you might also be interested in …

  1. extrace Command Examples in Linux
  2. nmcli radio Command Examples in Linux
  3. diff: command not found
  4. “az account” Command Examples
  5. How to view linux disk partitions (partition table)
  6. btrbk: command not found
  7. mkdir and rmdir Command Examples in Linux
  8. dar: command not found
  9. CentOS / RHEL : How to prioritize the devices used for swap partition
  10. How to Recover from a Corrupted or empty /etc/mtab file in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • “glab alias” Command Examples
  • gixy Command Examples
  • gitsome Command Examples
  • gitmoji Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright