Rooting the root
Ever had one of those times when you’ve fired up an old Linux box, gone to do something that needed root and forgotten your password? Yeah… Me neither. But! I’ve put together this little tutorial to help you reset the root password should you ever forget it.
You will need a live distribution for this (a live distro is a Linux distro that boots and runs off of a cd). I used Knoppix for this article but you can take a look at distro watch to see other Live distributions.
First of all, Insert your live distribution into the CD-Rom drive and reboot. Once the machine has restarted and you are sitting on the Live distributions desktop change the crappy wallpaper you can begin.
1. Open a new terminal session and mount our target drive (e.g. mount /dev/hda1)
2. Once the drive is mounted we want to chroot to it (e.g. chroot /mnt/hda1 ) - this will will virtually log you into the broken distribution as the root user (No password required).
3. Open /etc/passwd with a text editor and locate the line that begins with root:x:………. Once you have found this line delete the x as this is what tells the computer that this line is shadowed.
4. Open /etc/shadow and search for the entry for root. Delete all the values on this line so that it looks like root::::::::. Save the file and proceed.
5. Take out your live distribution cd, boot into Linux and login as a user other then root
6. Now you can use passwd root to set the new root password, for example:
# passwd root
Changing password for root
New password:
Verify password:
All done!
March 27th, 2006 at 4:34 pm
Impressive Skelm!
I dont use a Linux, but why not in the future? For today, I’m using the traditional old Windows XP SP2.
Linux is for free and many computer come with them here, so not hard finding linux to use.
Really intresting and nontheless usefull!
Keep on writing Skelm
~komodo
March 27th, 2006 at 4:42 pm
Komodo,
and hey, if you ever get an old computer and you don’t know the root password at least you will be able to recover it
March 27th, 2006 at 4:53 pm
that’s a neat trick
March 27th, 2006 at 5:59 pm
Wow!
March 27th, 2006 at 7:18 pm
The process, simplified: (You don’t even need to download, burn, and wait for a fancy livecd to boot or edit any /etc files)
1. Boot your distro’s installation CD and go to a console (probably Ctrl+Alt+F1 if it has some crappy graphical installer that doesn’t include this as an option)
2. Login as root (password should be blank)
3. # mkdir /mnt/drive
4. # mount -t auto /dev/hda1 /mnt/drive (modify as needed)
5. # chroot /mnt/drive
6. # passwd (do what it says)
7. Eject CD and reboot
December 23rd, 2006 at 7:19 am
Hello!Just a testing
January 5th, 2007 at 8:58 pm
Well, I hope you’ve found the direction for this..so far..so good…I finally got my site up and made my first profits…take a look..ok? CYA
April 28th, 2007 at 8:06 pm
chinese erotic art…
Reviews on chinese erotic art….
June 3rd, 2007 at 8:04 pm
ps3 mod chip…
ka-ka-sh-ka 2032298 Features of ps3 mod chip….
June 4th, 2007 at 1:41 am
restaurant chicago il…
ka-ka-sh-ka 2032298 Research about restaurant chicago il….
June 4th, 2007 at 4:10 pm
collection lawyer new jersey…
collection lawyer new jersey foundation…
June 5th, 2007 at 3:19 pm
box insider red…
Advantages of box insider red….
June 7th, 2007 at 9:34 am
game new yankee york…
game new yankee york intro article…
June 8th, 2007 at 8:38 am
old country roses…
Master information for old country roses….
June 8th, 2007 at 1:05 pm
heavyweight dub champion…
Eye of heavyweight dub champion…