If you forgot your root password or to login to Ubuntu (for recovery) without the root password, follow these simple steps:
- While the computer boots, press ‘Esc’ as soon as the Grub loads to go into the menu.
- Press ‘e’ to edit the boot menu
- Select the kernel line and again press ‘e’
- remove the words ‘ro’, ‘quite’ and ‘splash’
- put these words at the end – ‘rw init=/bin/bash’
- press enter to accept
- then press ‘b’ to boot into linux
Now you will get to the root shell in a while. Mount all partitions using ‘mount -a’ command (somtimes some partitions are not mounted). Then use ‘passwd’ command to set a new password. Or, you can perform maintenance task right there.