1. Reboot the system.
2. When the boot loader menu appears use the arrow keys to select the distribution install you want to edit. Next press "A".
3. You will be given a grub prompt that looks like the following.
grub append> ro root=LABEL=/
4. Put the word "single" at the end of the grub append prompt and press enter. Note there is a space before the word single.
grub append> ro root=LABEL=/ single
5. The system will boot into single-user mode. At the prompt enter passwd root and enter the new root password.
sh-2.05# passwd root
6. Now reboot the server and you should be able to log back in as root
How to recover the root password on Redhat Fedora and CentOS - My How To Articles.