Resetting Your Linux Password

If you cannot remember your password on a Linux operating system, you can simply reset it within minutes. Here is how to do:

  1. The only thing you need is a bootable Linux Live CD or USB thumb drive. You will also need “sudo” command to achieve this, make sure you have root privileges on your bootable Linux media.
  2. Once you boot into your Live CD/USB, mount the disk partition which Linux is installed on.
  3. There is a (magical) Linux command: chroot. This will allow you to change your root directory to mounted partition. Open terminal and run this command.: (Change “/media/disk” to your mount location.)
    sudo chroot /media/disk
  4. When the prompt changes, run this command, and enter new password: (Change “user” to username whose password to be reset.)
    passwd user

After setting the password, you can now restart the computer (do not forget to remove Live CD/USB), and login using new password.