This is for resetting your root password when you are unable to remember it, someone changes it and doesn’t tell you or can’t put a cd in the system to boot into rescue mode.
First thing to do is restart the server and wait for the boot loader menu [GRUB] to appear. At the menu, use the arrow keys to highlight the installation you want to edit and type [a] to enter into append mode. You should then see the following prompt:
<grub> ro root=LABEL=/
From here simply press the space bar to add a space and type single so GRUB will boot into single user mode.
<grub> ro root=LABEL=/ single
Hit [enter] and GRUB will boot Linux to single-user mode and drop you to a shell prompt. It should look simlair to below.
To reset the password simply type the following.
sh-2.05b# passwd root
You will be asked to change the password then re-type the password for verification. You can then reboot by typing “reboot” at the prompt; then you can log in to root as you normally would.