One of our customer forgot his Red Hat Enterprise Linux 5 server root password. He request us to reset his root password. Below are the few simple steps that i did to reset the root password.
- First thing i have to do is to reboot the server and enter to the single user mode. Once you reboot the server and wait until the GRUB menu screen come out.Select the desired kernel you want.
- Press the ‘e‘ key to edit that entry.
- Use the arrow keys to navigate to the kernel line (for example: kernel /vmlinuz-2.6.x-x ro root=LABEL=/ rhgb quite)
- Add the argument ‘single‘ to the end of the line and then press ENTER. (for example: kernel /vmlinuz-2.6.x-x ro root=LABEL=/ rhgb quite single)
- Press the ‘b‘ key to boot in to single user mode.
- You will then be presented with a shell prompt similar to the following:
sh-2.05#
- To change the root password, just type passwd root
- You just enter the new password twice
- After change the password, you just reboot your server.
- Now you should be able to login to your RedHat Enterprise Linux server with the new root password.