HostOnNet Blog

How to Reset Forgotten Linux Root Password

Looking for Linux Server Admin or WordPress Expert? We can help.

Whenever you can’t remember your Root password, you can do this steps to reset it.

You can log in with single-user mode and create a new root password.

Reboot your computer. When GRUB is presenting the menu list, follow those instructions:

use the arrows to select the boot entry you want to modify
press e to edit the entry
use the arrows to go to kernel line
press e to edit this entry
at the end of the line add the word single (there should be a space between like / single)
press ENTER to go back to the parent menu
press b to boot this kernel

As root, changing password does not ask for your old password. Now, you can change root’s password by typing:

bash# passwd root

You’ll be asked to re-type the password for verification. Once you’re finished, the password will be changed and you can reboot by typing shutdown -r now at the prompt; then you can log in to root as before

If your boot loader is LILO follow this

At LILO boot loader type linux single and press [ENTER] key:

Boot: linux single

When you get the # prompt you will need to type passwd root to reset password:

# passwd root

Reboot system:

# sync
# reboot

Posted in Linux

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.