Wednesday, October 29, 2008

Breaking root password at Debian

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.

No comments: