LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   RH9 login password recovery (https://www.linuxquestions.org/questions/linux-security-4/rh9-login-password-recovery-321686/)

DanielTan 05-09-2005 11:32 AM

RH9 login password recovery
 
Hi, how can i restore my RHL9 login password ? I just can't get it right although i clearly remember it. Thanks.

Regards
Daniel

marghorp 05-09-2005 11:44 AM

IF this is a users password you are talking about, just login as root and change that users password to what you like. If this is the roots password, reboot the machine, pass a kernel argument single to your kernel, so the line looks like this:

kernel /boot/vmlinuz...... single

and boot that. You will come into single mode, where you can change the roots password by simply typing in the passwd command. However you should try thinking of protecting your computer against such a password change, with a GRUB password.

DanielTan 05-10-2005 09:15 AM

How come the root password suddenly can be loss or unrecovered or ..... ? do u mean i have to use linux boot disk or cd to pass a kernel argument ?

Regards
Daniel



Quote:

Originally posted by marghorp
IF this is a users password you are talking about, just login as root and change that users password to what you like. If this is the roots password, reboot the machine, pass a kernel argument single to your kernel, so the line looks like this:

kernel /boot/vmlinuz...... single

and boot that. You will come into single mode, where you can change the roots password by simply typing in the passwd command. However you should try thinking of protecting your computer against such a password change, with a GRUB password.


Simon Bridge 05-11-2005 09:09 PM

DanielTan:
I've done this in RH9 - it goes like this:

1. either boot into single user mode via GRUB or from the installation disk.

1.a) via GRUB
When the GRUB screen shows up (on reboot) press "e" to edit the GRUB configuration. You see three lines, the middle one starts with the word "kernel". Select the kernel line - press "e" again, and anter the word single at the end of the line. Enter gets you out of there and "b" will boot the selected kernel.

1.b) boot from an installation disk - you'll go into single user mode.

You need to edit the /mnt/sys/image/etc/shadow file. There is a line starting "root: blah blah blah : other stuff : more stuff : etc :" - get rid of everything between the first two colons. That removes the password. Save changes and reboot - log in as root and you'll be prompted for the new password.

Info courtesy of Mad Dog Hall.

J.W. 05-12-2005 01:42 AM

Perhaps this is slightly OT, but this question also points out that having physical access to a machine gives someone the ability to defeat any and all security measures that may have been put in place. Keep your important machines behind locked doors! -- J.W.


All times are GMT -5. The time now is 07:33 PM.