General discussion

Locked

Forgot Root Password

By emekaa ·
i forgot the root password to my linux server (redhat linux version 7.1), is there a way for me to create a new password without my reinstalling lunux?

regards,
emeka

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Forgot Root Password

by blue_paladin In reply to Forgot Root Password

If I remember correctly, here's what you can
do:

1. When bootup menu appears, hit the ESC
button to enter the extra parameters mode.
You should now see a black console-like
screen.

2. Enter:
linux single
(and hit return)

3. Once Linux finishing booting you will be
in single-user mode without networking.
Change your password to one you can
remember (there is no way to recover your
old password that I know of) with the
passwd command or one of the graphical
tools like linuxconf.

4. Reboot - the new password should now be
active.

Collapse -

Forgot Root Password

by blue_paladin In reply to Forgot Root Password

For those that might now be concerned that
Linux has no security, I should mention
that both LILO (the default bootloader of RH
7.1), the Linux kernel, and the Linux boot
partition can be (and should be) password
protected. Once this is done, there is no
way to avoid entering the correct password
aside from wiping and repartitioning.

Collapse -

Forgot Root Password

by emekaa In reply to Forgot Root Password

Poster rated this answer

Collapse -

Forgot Root Password

by steve.fice In reply to Forgot Root Password

The easiest way to fix this is to start your linux box (either from a boot disk or normally through Lilo) and when you get the LILO: prompt, instead of just witing for it to boot, type in the following

linux single

and then press return. This will (eventually) bring you to a prompt that should be similar to the one below:

sh#

From here simply type passwd and then enter the new passwd (after writing it down of course) twice and reboot.

Collapse -

Forgot Root Password

by emekaa In reply to Forgot Root Password

Poster rated this answer

Collapse -

Forgot Root Password

by taisn In reply to Forgot Root Password

There is another way to restore root password , if the hard disk with lost password is mounted with any functional Linux Server. Once it is mounted, edit its /etc/shadow file and set it to the following pattern which will reset the password.

root::11592:0:99999:7:::

Tahir
Pakistan

Collapse -

Forgot Root Password

by emekaa In reply to Forgot Root Password

Poster rated this answer

Collapse -

Forgot Root Password

by taisn In reply to Forgot Root Password

Thanks for recognizing my answer to your question.

Collapse -

Forgot Root Password

by emekaa In reply to Forgot Root Password

This question was closed by the author

Back to Linux Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums