Back in the old days, and by the old days I mean about half an hour ago, if you forgot your root password to a Linux machine which you had physical access to all you needed to do was enter the grub menu, press ‘e’ on the line that said kernel and append the word ‘single’ to the line and press enter to boot into single user mode. As far as i know, this still works on Fedora and RHEL machines, distributions which are usually in a data centre or at least in a locked server room, but perhaps with the rise of Ubuntu on laptops and netbooks, Ubuntu developers became aware that physical access to the hardware was no longer a silver bullet security wise and so have updated grub to deny you gaining a single usermode. They have a recovery console to help with troubleshooting but before you get to that revered bash shell, you are prompted for the root password. Spoil sports.
However, there is a way around this issue. At this point let me say that I found this while trying to reset on a device which I had permission to use. If you perform this on anyone’s hardwre but you’re own get the device owners express permission first.
I have a Zotac Zbox for a project in work. It is running Ubuntu Server 13.04 and the usual passwords don’t work for it. So to get root do the following. As before get into the grub menu by pressing ESC just after the BIOS screen. On the image you want to access, most likely the top one press ‘e’. Then find the line that has “ro”, meaning read only and change it to “rw” then append, without the quotes “init=/bin/bash”. Finally press F10 to boot with these settings. After a brief boot time, you should be in a root shell.