Tuesday, November 15, 2011

How to change the root password for root user on Redhat.

How to change the root password for root user on Redhat.

Plan:
Two steps to change root password on RedHat.

- You need to have physical access to the server or have a console access to the system.
- Boot the system to the single user mode and change the pw.


Steps:

1. Reboot/poweron the server.
2. On grub menu press e to go to edit mode.
3. Select the boot line from the list and press e again.
4. Insert an space and type the number 1 ( or type single)
5. Press ENTER and press 'b' and ENTER again.
6. You are in single user mode without a password.


--------------------------Detail-------------------------

1. Login to the console. Boot/reboot the system and and press F12 for boot menu.

# reboot or @ shutdown -r
or
CTRL+ALT+DELETE
or
power cycle [ be careful, you may have to run fsck)

2. Edit the grub menu
Select (High Light) the kernel you want to login to and change the pw.
Note: Use the arrow keys to move to different the kernel line and to disable the automatic boot counter timer.

3. Press the 'e' key on the keyboard to edit the entry.
For eg.:- kernel /boot/vmlinuz-............

4. Press the 'e' key to edit the line, and you will be at the end of the line.

5. Now, verify your cursor is on correct position. Press the space bar, and type single; and press the enter key.
kernel /boot/vmlinuz-x.x.x.x.x.abc ro root=/dev/sda1 single

6. Press the 'b' key to continue the boot process.

7. You will be on single user mode. Change the root pw. create other users if needed.
# passwd root

8. Reboot the system.
# shutdown -r now.

you done ..

No comments:

Post a Comment