Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu. (Sometimes you have to choose ADVANCED mode)
From next menu select the one with the recovery mode in the description
From Recovery Menu choose Root - Grop a root shell menu
You should now see a root prompt, something like this:
root@ubuntu:~#
At this stage you should have a read-only filesystem. You have to remount it with write permissions:
mount -rw -o remount /
Now we can set the user's password with the passwd
command. (In this example I will use jorge as the example, you need to substitute whatever the user's username is):
root@ubuntu:~# passwd jorge
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@ubuntu:~#