Press SHIFT
after you start your computer until GRUB’s menu appears:

Once you reboot to Grub menu, select the first menu item or the menu item you normally use to boot your Ubuntu system and press e
to edit:
Once in the Grub’s boot menu edit mode use navigation arrows to locate a line starting with linux
and edit it to include or append read-write mode rw
and init=/bin/bash
.
Once ready press CTRL+x
or F10
to boot.
Reseting root’s password
root@(none):/# mount | grep -w /
root@(none):/# passwd
Reboot System
Reboot your system using the following command:
root@(none):/# exec /sbin/init