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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. Unable To Boot Up Linux OS with Auditd (CentOS/RHEL)
  2. ip: command not found
  3. pacman –upgrade Command Examples in Linux
  4. kubectl: command not found
  5. How to Check Swap Usage Live via the ‘top’ Command in Linux
  6. “WARNING: Duplicate VG name [vgname]” – error while running LVM commands
  7. xeyes: command not found
  8. “Abort command issued nexus” error messages in /var/log/messages file
  9. at Command Examples in Linux
  10. Mutt, Mail and Telnet – Send mails from linux command line or terminal

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright