Forgot root password? Change root password for Linux in runlevel 1.

Forgot root password? Change root password for Linux using runlevel 1.</p>

If you are unable to remind your root password, then you have to boot your Linux machine and enter the runlevel 1 for single user mode, you can do this using below steps:

1. Power on your Linux Machine. You will get the grub screen.

2. When the GRUB screen appear, press any key on the keyboard, You will get the operating system list installed on your system.

3. Then Select the (operating system - may be linux or fedora or etc..)option that you want to change the root password using the ‘up’ + ‘down’ arrow keys. Press ‘e” key to edit the boot command.

4. It will display selected kernel - grub. Again use the up + down arrow keys to highlight the kernel (e.g kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet ) then press “e” key to enter the GRUB edit mode. You will get the linux system in whatever the runlevel you want.

5. Add the runlevel number that you want to boot into, the example below show that we add number “1” at the of that line to boot up Linux operating system using runlevel 1 for single user mode. (e.g kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet 1 )

you can use:

1</p>

S

or

single</tt>

6. Then press ‘Enter’ key to apply the changes and exit the GRUB edit screen.

7. Then press the “b” key to start the boot up process of Linux system in the runlevel 1 mode. (single user mode)

8. After completing the boot up process in runlevel 1, the linux operating system installed on your system give you the shell screen that ready to be use…. Notice that hash sign ( # ) on the screen… this usually indicate that the current user is root user.

9. To change the password for root; use the Linux ‘passwd’ command, see example below:

# passwd    [Type in 'passwd' command and hit Enter key]
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:


passwd: all authentication tokens updated successfully.

sh-3.1# reboot      [<-- Type in 'reboot' command and hit Enter key to start reboot your PC]

10. Then after the reboot process complete, login to your Linux system and use the new root password you have specified.

Note: if something like passwd: Authentication token lock busy message display on the screen execute command below:

sh-3.1# mount -o remount, rw /    [Then hit the Enter key]

and then execute the password command again:

sh-3.1# passwd   

Congrats!! password for your linux system has been reset.

</div>

comments powered by Disqus