Wednesday, August 17, 2011

How to Reset "root" Password with GRUB on Enterprise Linux


How to Reset "root" Password with GRUB on Enterprise Linux [ID 431260.1]
Modified 10-JUN-2009 Type HOWTO Status PUBLISHED
In this Document
Goal
Solution
References

Applies to:

Linux Kernel - Version: 4.4 to 5.3
Linux x86-64
Goal

If somehow you have lost the password for the system administrator user "root" you will need to reset it. This document provides a practical method to do that if you have configured system with the GRUB boot loader during the OS installation.
Solution

It procedure is to boot the system in the "single user" mode and to be able to do that you must be on the system console. Please follow the steps below:

1. Reboot the system
2. When the GRUB menu is shown with list of kernels to boot or count down for boot kernel is seen immediately do the following.
3. Use the arrow key and choose the kernel you want to boot
4. Press key a to append kernel arguments before booting
5. Next line will look something like this:
grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet
6. At the end of the line press space bar once, then add text single or 1:
grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet single
or
grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet 1
7. Then press enter/return, system will start to boot. The esc key will cancel your edit.

8. This will bring you to a shell prompt and now you can use the passwd command to change the password for the "root" account:
sh-3.00## passwd
Changing password for user root.
New UNIX password:
...
...
After the password is reset type
# reboot
and after system has been completed booting you can logon with the new root password.

No comments:

Post a Comment