Change Forgotten Root Password in Redhat 9

 

GRUB METHOD

 

There are a number of different ways to do root password recovery on a Linux system. Different distributions make it easier than others. RedHat makes it very easy.

You must be physically in front of the system. Reboot the computer
(usually ctrl-alt-delete will do it safely) and after POST, the system
will come to a boot loader screen. Newer versions of RedHat (including the
AS versions) use grub as the boot loader, so you should see a graphical
menu in which to select what kernel you want to boot. See below:

 

Select the kernel to boot and then hit 'e'. This will take you into a mini-editor where you can change the line that's used to boot the system. What we want to do is to
pass an additional argument to the kernel, telling it what runlevel we
want to boot into. This will override the default runlevel setting in
/etc/inittab.

So after hitting 'e', we cursor down to the line that starts with 'kernel'
and cursor all the way to the end of the line.
It shoud look something like this:

 

kernel /vmlinuz-2.4.18-0.4 ro root=/dev/hda2
 

Put a space after any existing kernel arguments and type the number '1' (without the single quotes). Hit enter here to accept the change and you're back at the grub
boot screen. Then hit 'b' to boot to this line. The system will start booting and should look similar to the screenshot below:

The system will boot into runlevel 1 (single user mode) and you will be dropped to a root prompt without being prompted for the password. This screen appears:

From here you can type 'passwd' to change the root password. When you're done, type 'exit' and the system will boot to the default runlevel.


 

LILO Method

 

rhwinston_boot.png

 

If you are using LILO, at the LILO boot prompt (if you are using the graphical LILO, you must press [Ctrl]-[x] to exit the graphical screen and go to the boot: prompt) type:

 

# linux single
 
Once logged in, just type passwd and enter your new password.


Copyright © Joe Pearce 2004 • Copyright © Northeast State Technical Community College 2004

®Redhat and the Redhat ®"Shadowman" logo are registered trademarks of Redhat Linux.