Hopefully not but from time to time, we may somehow forgot what our root password is. This can happen in the case where you are managing a teaching laboratory, CAD/CAM workstations or your grandmother’s OpenSuSE PC! These are situations where once the machine is setup, you rarely need to have system administration access. So, the first answer is … re-install!
Heck no, an easier way is to
- Boot into single user mode
- Change password
- Reboot
Booting into single user mode
Assuming that you did not password protect your GRUB boot loader (default boot loader for most Linux distribution), to boot into single user mode in most Linux distribution, you simply need to ask it to boot into single user mode (runlevel 1) but as rightly pointed out (see comment), in OpenSuSE, instead of simply pressing “1” when greeted with the following screen, you need to instead input “init=/bin/sh“. By pressing “1″, you will still be required to enter the root password.
(Note, not all GRUB screens are like that, if by pressing “1”, it boots immediately, then the next time, press ESC to go to the text based menu. From there, select the entry and press “e” to edit and then go to the boot instruction line and press “e” again. You can then add the “1” at the end of the command. Press “b” after that to boot)
Change password
Once in single user mode, you should just get the following command line prompt.
|
your-hostname:~ # |
You are actually logged in as root (superuser) and you can change the password from there.
|
your-hostname:~ # passwd |
Enter your new password (and this time remember it!). You should see the following to confirmed that the password has changed.
|
Reenter New Password: |
Reboot
Simlpy type,
|
your-hostname:~ # reboot |
Your root password has been reset!




It does not work like that on SUSE
Try it out and see it booting in runlevel 1 work without giving root password.
try “init=/bin/bash” in place of “1″
[...] earlier posting was for OpenSuSE, but for SuSE, the security is even tighter. The following technique would [...]
It worked on SLES 10 like a charm!
only put 1 at boot