Reboot to Grub MenuIn the first step you need to reboot your Ubuntu 16.04 Linux box to Grub's menu. If the Ubuntu 16.04 is the only installation available keep pressing
SHIFTafter you start your computer until GRUB's menu appears:
Edit Grub MenuOnce you reboot to Grub menu, select the first menu item or the menu item you normally use to boot your Ubuntu system and press
Alter boot menuOnce in the Grub's boot menu edit mode use navigation arrows to locate a line starting with
linuxand edit it to include read-write mode
init=/bin/bash. For example
linux /boot/vmlinuz-4-4.0-22-generic root=UUID=43ad24d3-e\ c5b-44ee-a099-a88eb9520989 ro quiet splash $vt_handoffCHANGE TO:
linux /boot/vmlinuz-4-4.0-22-generic root=UUID=43ad24d3-e\ c5b-44ee-a099-a88eb9520989 rw init=/bin/bash
Once ready press
Reseting root's passwordIf all went well you should now see root shell command line and your root partition should be mounted with read/write flags. To confirm run:
root@(none):/# mount | grep -w /
Now we are ready to reset root's password. To do so, simply run
passwdcommand with no arguments. When prompted enter your new root password:
All done. Your root's password is now reset.
Reboot SystemReboot your system using the following command:
root@(none):/# exec /sbin/init
Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error passwd: password unchangedYour root partition is mounted read-only. Try:
# mount -o remount,rw /to resolve this issue.
[ end Kernel panic - not syncing: Attempted to kill init! exit code=0x0007f00Make sure that you removed
splashboot option when editing grub's menu item.
When trying to reboot with
rebootcommand I get:
Failed to connect to bus: No such file or directory Failed to talk to init daemon.Ignore, and reboot with:
# exec /sbin/init