Wednesday, March 4, 2009

Changing Root Password Without a live CD/DVD

Changing Root Password Without a live CD/DVD

I have been reading most article about root password recovery, but all these articles seem to be concentrating on the use of a live CD to get to the file system in order to get to the /etc/shadow file.
I tried to do this using another method.
NB: I tried this using Opensuse 10.3 and i guarantee it will work for anyone using the same kind of OS.
Note that if you have any password on your grub bootloader, then you should not forget it other wise this approach won't work.

1. When the bootloader appears, press the esc key.

2. Press the 'e' key to edit the kernel parameters.

3. Use the arrows to navigate to the kernel parameter settings

and press 'e'.

4. Enter init=bin/sh

5.Press b to boot to a shell.

6.Vim /etc/shadow.(You will a lot of encrypted passwords for all

users of the system.)

7.To be on a safer side, copy the encrypted password for the

root user, and delete it

eg.

root:9PDtCPkwEcE8U:14277::::::

the encrypted password "9PDtCPkwEcE8U" should be deleted

in order to get something like what is below

root:*:14277::::::

Now that your root password is wiped off,

You can safely enter the administrative mode (single user mode I.e runlevel 1)

without entering any password.

Now, reboot your machine and repeat steps 1-3

Then enter single at the end of the parameters passed to the kernel and hit the return key.

This will take you into the single user mode without a password

Now, enter this command

passwd

This will ask you for a new password

Enter it and reconfirm

You now have a new root password

you can use this command to get to the graphical mode(runlevel 5).

init 5

GOODLUCK,


No comments:

Post a Comment

TechNEws