#1  
Old 21st April 2005, 15:07
leno leno is offline
Junior Member
 
Join Date: Apr 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forgot root password

I've forgotten the root password of my desktop computer.
Is there a way I can set a new one so that I can login as root again?
I know this shouldn't have happened, and I could beat my head on my table all day long... Grrrr...

Leno
Reply With Quote
Sponsored Links
  #2  
Old 21st April 2005, 16:58
tylerdurden tylerdurden is offline
Junior Member
 
Join Date: Apr 2005
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Default

Get a rescue CD (e.g. from here: http://rescuecd.sourceforge.net/download.html), boot your computer from it, then login as root (if you use the rescue CD mentioned before, the password is rescue, then mount your hard disk, chroot to it and set a new password for root:

Code:
mount -t auto /dev/hda1 /mnt
cd /mnt
chroot /mnt
passwd root
Reboot your PC (don't forget to take out the RescueCD), and should be able to login as root.

tyler
Reply With Quote
  #3  
Old 22nd April 2005, 11:01
leno leno is offline
Junior Member
 
Join Date: Apr 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks tyler, you were a great help. I have root access again!

Leno
Reply With Quote
  #4  
Old 8th October 2005, 23:40
themachine themachine is offline
Senior Member
 
Join Date: Oct 2005
Location: Texas, USA
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default /bin/bash it!

Just a reference for anyone else reading this... you can just as easily change root's password with out the use of a LiveCD.

reboot the box
at the boot loader do the following:

LILO:

linux init=/bin/bash

GRUB:

type 'e' to edit the default kernel line
then 'e' again on the line that starts with 'kernel'
add 'init=/bin/bash' to the end of the 'kernel' line
<ENTER>
type 'b' to boot it

once you're at a /bin/bash prompt...

remount the filesystem read/write (will be ro when bin/bash'ing)

# mount -o remount,rw /

then change the passwd

# passwd root

remount the filesystem read/only (keep things clean)

# mount -o remount,ro /

CTR-ALT-DELETE (though this will result in a kernel panic most likely)

reboot the system and you should be good to go.

This however will not work if you've locked down the boot loader and have misplaced that password as well.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:39.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.