Saturday, August 27, 2011

How to reset your forgotten linux (ubuntu) password

Well, this is what you have to do if you are unable to use GRUB (GNU GRand Unified Bootloader).
Last day my cousin came with her laptop (Lucid Lynx installed) saying she forgot her password. Alhamdhulillah and thanks whoever posted this for coming to rescue me. Even though it was detailed on "makeuseof" I though to share my experience.

  1. Boot from a live CD and hit "Try Ubuntu"
  2. When system is ready open terminal and check the partition in which linux is installed (mine it was /dev/sda1). You may use the command sudo fdisk -l
  3. Make a mount point for the partition (I have created a directory called linux_part [sudo mkdir /media/linx_part])
  4. Mount linux partition on the directory created sudo mount /dev/sda1 /media/linx_part
  5. Change the root to mount directory (sudo chroot /media/sda1)
  6. Type passwd username and enter new password to change the password.
  7. That's it, now reboot your computer.