forgot root

ratkil

Platinum Member
Jan 12, 2000
2,117
0
76
I forgot the exact way, but isn't it pretty easy to break into a linux box if you are at the console?
 

IBhacknU

Diamond Member
Oct 9, 1999
6,855
0
0
nah...

I remember when I installed, Mandrake 7.2 wouldn't take the 6 characters I usually use. So I added a couple more.

DRATS!
 

tontod

Diamond Member
Oct 12, 1999
3,244
0
71
I think you can use a rescue disk to boot into the kernel and go edit the /etc/password file. Or something along those lines.
 

Soybomb

Diamond Member
Jun 30, 2000
9,505
1
0
at lilo prompt type
linux single

then when it boots change the root password :)
 

Elledan

Banned
Jul 24, 2000
8,880
0
0
Unless you can get help from a hacker/cracker, I doubt you can get your root password back...

Some people do write their root password down on a piece of paper and put this in a safe place ;)
 

IBhacknU

Diamond Member
Oct 9, 1999
6,855
0
0
hmmm... the boot disk I have says I can enter some parameters instead of booting off hda1
 

Phil21

Golden Member
Dec 4, 2000
1,015
0
0
heheh..

Boot via the bootdisk. You'll also need a rootdisk. Boot into the setup menu, or whatever the heck mandrake has. Exit it somehow (possible alt+f2?) so you get a prompt. Mount your /etc partition (or /, or wherever /etc is on) via mount /dev/hda1 /mnt (change hda1 to your hard drive/partition).

now comes the tricky part. I'm going to take a passwd string from my box to give you.

root:$1$0edUulDr$D3A8lHrBG6PZE18D58gkX.:11411:0:::::

that line should work to replace your current line in /etc/passwd for root. But, this assumes you have support for md5 passwd's (you probably do, I'd guess). This password is temp ("temp").

you would edit /mnt/etc/shadow to change that.

If that's above your head.. You can also try to use chroot. This is a lot more tricky. If you have your entire / on one drive, it's pretty easy though. (if you have /bin /etc on one drive that is) Just do a chroot /mnt passwd and it should change the password for you. But, this assumes your entire directoy tree off your hard drive is mounted in /mnt.

*shrug* hope that helps a bit. :p

-Phil


 

Soybomb

Diamond Member
Jun 30, 2000
9,505
1
0
lol anytime, if you didn't use lilo or had it password protected and forgot the pass or something then you can use the other methods, but I think this one is simpler ;)