Sunday, November 12, 2006

Recover password in Linux SuSE 10

After not using my root password for a long time, I needed it today.
But I couldn't remember it anymore! I could login with my regular user 'dgielis', but that was it... My user didn't have enough privileges to change system settings or do other "root" things. I was just a regular user.
I searched for changing my root password... and finally found it.
This is how I did it:
- On the boot screen (Gui Boot Loader of SuSE) type "init=/bin/bash"
- You get a terminal screen with almost nothing initialized or loaded (! attention keyboard lay-out can be different)
- Type at the bash prompt: mount -o remount,rw /
- To change the password, type: passwd (give a new password)
- This worked for me, if it doesn't work for you, this link can help you further.

2 comments:

vashik said...

It works for many different Linux distros, not only SuSe.

Unknown said...

Hello, I haven't been able to recover the lost password. I do the steps, but after mounting the sda and trying to edit de passwd file, I found that it has only the basic users and not all of them, so it's still the one on de the cd. The chroot doesn't work, and if I search in /mnt there is no sign of my files. What can I do? PS: I didn't set the computer up, I just lost the password.