Monday, December 6, 2010

How to Reset CentOS or RHEL root password

In order to reset the root password for GRUB users, follow these steps:

1) Reboot Machine and when the GRUB menu appears.

2) Press letter "e'' on the keyboard to enter edit mode.

3) Use arrow keys to select the kernel line for kernel to be booted and then press "e" to edit and go to end of line and type "single" (without quotes) as a separate word,

           append "single" to ro root=LABEL=/ single

4) Press ESC key to exit the edit mode.

5) Press "b" to boot into single user mode

6) Enter passwd at cmd prompt and reset the root password a prefered password.

In order to reset the root password for LILO users, follow these steps:

1) If you are using LILO, at the LILO boot prompt press Ctrl-x to exit the graphical screen and go to the boot prompt, and then enter:

        linux single

Once you enter linux single, this will make you the "root" user without asking for a password. Once the system has booted, you can change the root password using the password command:

         passwd

No comments:

Post a Comment