Although there's no real way to recover a lost root password, you can change the root password even if you do not know the current one. You must have physical access to the machine in order to accomplish this task. The following steps were originally noted on this MacNN forum, which contains a number of follow-up messages about security in general - well worth the reading time.
NOTE: The following information has been publicly disclosed on a number of Internet sites, and is not a new find. I'm simply repeating it here for the sake of completeness.
Read the detailed section of this article for step-by-step instructions on regaining access to your root account.
Originally posted by QuantumFusion on the MacNN forums, and repeated with slight readbility changes, here are the steps to regain access to root:
/sbin/mount -uw /You will then see various services starting up.
/sbin/SystemStarter
passwd rootIt will then ask you to type the new root password twice, so do so.
reboot
Mac OS X Hints
http://hints.macworld.com/article.php?story=20001217230925152