Changing Ubuntu Root Password
Boot from the Ubuntu Install CD.
when the first installation screen appears press CTRL+F2 to bring up another terminal and press Enter to activate it.
Create a mount point by entering mkdir /mnt
If you don't know the partition that you want to mount then enter the command cat /proc/partitions
For my example the root file system is installed on /dev/sda3
Now mount your root file system to the new mount point by entering the command mount /dev/sda3 /mnt
Now we need to change the root file system to the newly mounted one and this is done by entering the command chroot /mnt
Once you are at the command prompt you can now enter the passwd command to change the root password.