This happens periodically to me were I need to work in the Unix underpinnings of Mac OS X but have recently purchased a Mac computer either new or used with the OS already installed on it.
To set or reset the “root” password you need your system’s Mac OS X install disc. Insert the disc, wait for it to mount, then click on the “Install Mac OS” icon (or alternatively reboot and hold down the ‘c’ key to boot from the DVD drive). You are not installing the OS again, but you need to click through the Wizard pages far enough until you see the menu bar with “Utilities” as one of the menu pulldowns. In this menu is the command “Reset Password….” That’s it. As you can see it is very easy to reset the “root” password so if you are really security minded you might want to use an Open Firmware Password as well to prevent easy re-booting and resetting using the DVD drive.