• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

recover root password?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Mizzery

Member
Joined
Jun 9, 2002
Location
Troy, NY
I came home today to find my computer off. No problem, right?

I go to log in as root and the password didn't work

I vaugely remember one night changing it after a few drinks, but don't know what I set it too.

Any hope?

I konw you're not supposed to use root as your main loging, but i do.

Help please.

Thanks,

Chris
 
Use a distro that can run off a CD without installing to a hard drive, like Knoppix.

basically, boot from CD

Open a terminal and become root

mount your root partition

chroot into your root partition

then run- passwd root
 
I'm not sure if i'm doing this right as i'm not familiar with the chroot command, but i'm using it as follows:

su
cd /dev
chroot hda2

then i get as the output:

bash: /dev/null: Permission denied - this shows 5 times

same happens if i got into hda and chroot /
 
chroot /mnt/hda2 /bin/bash

Assuming /dev/hda2 is mounted to /mnt/hda2....
 
I'm starting to think its not the password. When i log in with the password i changed it to, it says authentication failed. When i put in a different password, it says incorrect username / password. Whats the authentication?
 
hmm, try creating a new user and add it to group "root" (can u do that?) perhaps your /etc/shadow got corrupted. I would say blow the /etc/shadow file and start over and recreate all your users. . . but im sure that would be really really bad. . .
 
I do remember going into some settings about shadow, but memorys from that night are vague. I don't mind killing all my users and rebuildin that if i have to. What file to i have to delete to do this?
 
Mizzery said:
I'm not sure if i'm doing this right as i'm not familiar with the chroot command, but i'm using it as follows:

su
cd /dev
chroot hda2

then i get as the output:

bash: /dev/null: Permission denied - this shows 5 times

same happens if i got into hda and chroot /


when in a live cd, root terminal type

mount /dev/hda1 /mnt/hda1
chroot /mnt/hda1 /bin/bash
source /etc/profile
passwd
*put in password*
exit
cd /
umount /mnt/hda1
exit


hopefully that will work
(that is if /dev/hda1 is your root partition, if it isnt adjust it accordingly)
 
or boot from live CD, mount your drive, cd to /etc, vi passwd and shadow, delete just the passwords section. reboot, login without password.
 
I've found out which line from my passwd and shadow file. How do i mount my hda2 (root) partition with write permissions from within overcloxix?
 
Back