Breaking root password at Debian

Sometimes we may forget the root password. Then we need to login by breaking password. If we do not know how to break it, then we need to reinstall the OS and loose many important data. I want to share one way of breaking password at debian.

While booting you will be prompted some options like debian kernel XXX options. If you does not press any key the OS get boot on its by default type. To break the password you must stop the booting by pressing a key.

1. Then press e to edit

2. then type

boot: Linux init=/bin/sh

and press enter.

3. This will boot OS on run level 1, which wont want any password. Here you will need to mount the following things.

init-2.03# mount -n -o remount,rw /
init-2.03# mount -avt nonfs,noproc,nosmbfs

4. Now you can go to /etc and remove the password. To do so you have to remove root password from /etc/passwd and /etc/shadow. So…..

init-2.03# cd /etc
init-2.03# vi passwd
init-2.03# vi shadow

That’s all. Now restart your OS and you will find that there is no root password. After logging as root just set a new root password.

Hope to hear from you about better procedure of breaking password.

There is another way to break password using knoppix. As far as I know knoppix is also a boot loader s/w that helps us to break root password of linux. But I did not ever break password using knoppix.

Advertisements

3 Comments »

  1. uzzal said

    suppose in linux, one pc restart momentarily.then how do u solved it?

  2. rezanayem said

    Uzzal,
    it may occur because of many issue.
    1. may be hardware problem.
    2. may be OS problem
    3. may be configuration problem of inittab file.

    If the problem is with hardware then you have to fix the hardware.
    If the problem is with the OS then install a fresh OS.

    If you boot your OS at run level 6 then the pc will restart momentarily. You have to change the default run level.
    ***normally this problem does not happen, as no one will keep their OS running on run level 5 by default.

  3. rezanayem said

    sorry for mistake at ” ***normally this problem does not happen, as no one will keep their OS running on run level 5 by default.”

    here the run level will not be 5 , it will be 6.

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: