Reset Opensuse root password

Forgotten the root password to your linux system? Don’t want to reinstall and lose your files or are you just plain lazy? Here is an easy way to reset the root password if you ever find yourself in that situation.

I must admit, I was surprised how easy it was. I had an old test box at home, and was too lazy to rebuild it so I did a bit of searching on the internet. What I describe below worked on OpenSuse 11.2, 11.3 and also 10.3.

For other distros and version, I cannot guarantee that it will work. But please leave a comment at the end of the post to let me and others know.

Turn the computer on and select the normal boot menu from the list:

OpenSUSE_boot screen

Once selected, tab down to the “Boot Options” box and type in the following:

init=/bin/bash if you are using GRUB Boot loader

linux init=/bin/bash if you are using LILO Boot Loader

If you are not sure what sort of bootloader you are using (and I certainly didn’t), I did notice that just before the boot screen appeared there flashed a quick message indicating the grub bootloader was there.

This will throw you straight into a Bash shell prompt which comes up even before the Single User mode loads and has the “/” root file system mounted. How cool is that?

Do a mount command to check if the root file system “/” is mounted as Read-Write.

If you notice the screenshot below, you will see that mine was mounted.

OpenSUSE_mount

Next, simply type the passwd command and enter a new password (as per below):

opensuse_linux:~ # passwd
Changing password for root
New Password:
Reenter New Password:
Password changed

Type in reboot and that’s pretty much it:

opensuse_linux:~ # reboot

Now, if you’re thinking that your system in insecure because you can change the root password so easily, bear in mind that you will need physical access to the box in order to perform the above. Furthermore, you can secure things a bit by password protecting the BIOS of even the bootloader if so desired.

Hopefully, the above will work for you and save you a bit of heartache if you forget/lose your root password.

Tags: , , , , ,
Previous Post

HIPIX Image Format

Next Post

Little Known Cisco Troubleshooting Command

Comments

    • dee
    • August 4, 2011

    Hi,

    I have recently forgotten my root passwd for my SUSE 10.1 box and tried changing it in the single user mode but unfortunetely the keyboard is getting disabled so i m able to type nothing…

    Im now clueless, please help me wat could be done..

    Thanks
    dee
    pradeep.aleti@gmail.com

    • mohamed arshad
    • October 19, 2011

    hi,
    it’s coming command not found

    • indi
    • October 21, 2011

    Hi,

    At what stage is it coming up ‘command not found’? Also, what version of Suse are you running?

    • indi
    • October 21, 2011

    Dee, are you able to type anything? Try hitting the TAB key before typing.

    • Selma
    • June 30, 2013

    Worked for me on Opensuse 12.2! Thank you very much!!!

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.