• 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. How to activate and mount 2 Volume groups with same names in CentOS/RHEL
  2. Basic vim commands (cheat sheet)
  3. git archive: Create an archive of files from a named tree
  4. kpartx: command not found
  5. gcov: command not found
  6. Understanding the rc Scripts in Linux
  7. “docker secrete” Command Examples
  8. keyctl Command Examples in Linux
  9. json5 Command Examples
  10. eva: Simple calculator REPL, similar to bc, with syntax highlighting and persistent history

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright