forgot root passwd

hi
i have a RHEL 4 and have forgot root passwd
tried to boot in by singel user and then changing the passwd but it's not letting me do that ......throwing some weird error as .......manipulation
i also tried to make a new user from CLI but even though it's not letting me in from that user as well .......
i even tried 'rm shadow' that dosent help as welll.....!!

please advice....

techbravo

Hi,
If you still have the install CD then boot from it into rescue/repair mode, mount the disk which hosts /etc/passwd & /etc/shadow and erase the root password ...
What weird error did you get when booting in single user ? is it password protected ? :confused:

Not sure what rhel4 means, though.

I seem to recall that one way around this is to boot the server from the op console port in single-user mode, and then to reset the password. When starting in this mode, you should not get a password prompt.

It stands for redhat enterprise linux 4 joeyg, provided the loader (grub or lilo) is not password protected, you can boot into single and reset root pw, i wonder what weird error techbravo is having :confused:

IS the filesystem mounted RW? if not remount it with
mount -o remounnt,rw /

Check the permission of /etc/shadow and /etc/passwd

Do history and see what commands were run related passwd

tail /var/log/messages and see related messages. Post here if u dont understand.

Good luck!

the error is as follows
passwd:authencation token manipulation error
i tried creating another user but it's not alowing me switch user
can i know how to swith user so that can be tried.....

i think that should work .......!!:slight_smile:

Without being crazy enough to test my hypothesis, this is only speculation, but if you have removed the shadow file, I wouldn't be too surprised if that's the reason you get this error.

Do you have a backup? Can you recreate it somehow?

The customary solution is to boot into single user (perhaps from a CD or USB stick) and edit the /etc/passwd or /etc/shadow file to have an empty password field for root. Then boot the regular system, log in as root, and set a new password.

I guess you missed...

Removing the shadow file is not a real great idea. I'm not sure that Linux can function without it.

delete the md5 hash from /etc/shadow

EXAMPLE:-
root:$1$VB6ha9a1RHfQ8vpcA.:14030:0:99999:7:::
delete md5 hash only.
root::14030:0:99999:7:::

:b:
sorry for late reply ....!!

to recover root pwd , what i did was boot in single user mode then did

1)pwconv that created shadow and pwd file in /etc then

2)sync - that synced both files shadow and pwd , after that i re-booted the system again in single user mode

3)then re-set passwd for root ........... :slight_smile: hurray :slight_smile:

hi

now that i have loged in as root and have been navagating for some time i did a init 6 or 8 not remembering that seems to have created a problem in re-starting system and that is throwing some error as
"please select Y to have file system check as there is some discrepency "

now if we select Y that starts file system checkup and at the end it re-boots the system , this is a looping thing .........

and if we dont select Y for fs check then it freazes the system only at cnt +D it gose to next line and then re-boots again this is also is a looping thing...........

plz check .....

[GOOGLE]techbravo >[/GOOGLE]

I fsck cannot repair the disk, you will probably need to replace it. For emergency troubleshooting, perhaps you can boot from a CD or USB stick again.

perhaps i can boot in single user mode after modefing the kernel options.
but i want it to be repair, permenantly not tempr..
i think the disk have to be re-structured for unix partation .... what say ?

techbravo