If you've got phisical access to the machine, it's not a big problem. There are different methods (depending on the distro):
1) You may have a possibility to pass option to kernel in grub. You should pass 'linux 2'. It will boot to single-user mode, where it logs you as root without a password, so you can use 'passwd' and change it.
2) From installation cd in 'rescue' mode - as in point 1.
3) Edit /etc/shadow (first line is 'root:encryptedpassword:....), delete the password between first two : and then reboot. You should be able to login as root without a password.