Tuesday, September 9, 2008

Ubuntu forgotten password

What to do when you forgot your password for your ubuntu machine?? Here are some simple steps on how to change the password using single user mode.

  1. Reboot the machine
  2. When grub is loading, press 'Esc'
  3. Choose 'Ubuntu kernel...........(recovery mode)'
    • Press 'e' to edit the kernel parameter
    • Append 'single init=/bin/bash' to the kernel parameter
  4. Press 'b' to boot from that particular kernel
  5. You will enter single user mode
  6. Your hard drive will be in read-only mode. Remount it in read-write mode
    • # mount -o remount,rw /dev/sda1
  7. Change your passwd
    • # passwd user
  8. Reboot your machine
  9. Access your machine using your new password
Congratulations, you just changed you user password using single user mode

No comments: