1) on grub-boot prompt.
press “e” to enter edit mode
2) then press downarrow to reach the line that starts with “kernel “
press “e” again
3) at the end of this line type in “init=/bin/sh” or “/bin/bash”
4) then press enter to make that change and press “b” to boot
in a few seconds you will be on your “#” prompt
5) only one step left
“mount -o remount rw /”
this step is necessary coz in this case root file system is mounted as read only.
6) finally type “passwd” and you get the screen to change the password
and then type in “init 6? or “reboot”