lost administrative passwd for ubuntu, fix?

1 Answer

  • 1 month ago

    There are a couple ways you could fix it.

    Method one would be to boot an Ubuntu LiveCD or USB. Open the terminal and enter "sudo su". This should give you root access. You don't need a password on a LiveCD. Then create a mountpoint for your root partition: 

    mkdir /mnt/root

    Then mount the root partition (your partition may have a different designation, this is just an example):

    mount -o rw /dev/sda1 /mnt/root

    Use the chroot command to access the root partition and allow you to run programs on it:

    chroot /mnt/root

    Finally, run the passwd command to change the password for the admin user

    passwd admin

    Method two is slightly simpler, but looks scarier. When the GRUB boot menu appears, hit 'e' to temporarily edit the entry. There should be a line that says something like 

    "linux /boot/vmlinuz-4.x.x.x.x-generic  blah blah blah"

    If there is an "init=<something>" option, change it so that it says "init=/bin/bash". If the init option is not there, add it on the same line as "linux." Then press F10 to boot. You should be dropped to a Bash shell very quickly. Once it loads, just enter 

    "mount -n -o remount,rw /" and then "passwd admin"

Still have questions? Get answers by asking now.