If you forgot your root password for your Ubuntu/Linux system you can recover using the following steps:
Turn your computer on.
Press ESC at the grub prompt.
Press e for edit.
Highlight the line that begins with kernel ………, press e
Go to the very end of the line, add rw init=/bin/bash
Press Enter, then press b to boot your system.
Your system will boot up to a password-less root shell.
Type in passwd username
Set your password.
Type in reboot