How to Retrieve Root Password on Linux Machine

Sometimes some people forget their root password on their Linux machine. And not recommended to install back the Linux since so many configuration have done during that period time. Now, we can retrieve the password as long as we have physical access to the Linux machine. There are 2 ways to solve this problem.

1st way
Reboot your Linux machine
Get into “grub” menu then press “e”
Go to your default kernel then press “e” again
Then go to grub prompt grub> default_kernel single <– type “single” at the end of your kernel. We are entering single mode.
Then it will appear as sh-3.00#
Then type “passwd” or edit /etc/passwd

2nd way
Reboot your Linux machine
Boot from 1st CD of your distro
Get into the “Rescue Mode”
Follow the instruction
We get into prompt again sh-3.00#
Type “sh-3.00# chroot /mnt/sysimage”
Then type passwd or anything you want

Congratulations you have your root password back. Don’t forget about your root password again in the future

  • Dual-boot ‘$100 laptop’ to run XP and Linux, What for?

  • Replace Your Cisco Router With Vyatta

  • Popularity: 27% [?]

    Posted on July 22, 2008 | 2 Comments | Filed under : Uncategorized

    2 Comments so far ...

    I think the simplest way is boot with “recovery mode” a.k.a “single user mode”
    And go to prompt then type “passwd” to get new password.

    Comment on July 24, 2008 10:50 pm

    Ou-yo-yu you have a nice little blog…it\’s now in my bookmarks ;0

    Comment on August 31, 2008 05:13 pm
    (required)
    (will not be published) (required)
    (opitional)