LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Lost passwords, how can I get back in? (https://www.linuxquestions.org/questions/red-hat-31/lost-passwords-how-can-i-get-back-in-86515/)

Skidlid 08-28-2003 02:11 AM

dudes i did a stupid thing somehow i have been locked out of my redhat box..i was mucking with the password files etc, long story, anyhow any one know how i may be able to get into it with out a full os reload.????

BRING ON THE FLAMES

MasterC 08-28-2003 03:59 AM

Splitting out into it's own thread as this thread is for the introduction to this forum ;)

Cool

MasterC 08-28-2003 04:02 AM

If you have your install CD's, you can get into a command prompt using rescue mode. At that time, you can change root's password:
passwd

Alternatively:

Get into that same command prompt, open up the /etc/passwd file, and you see that "x" after the username, but before the uid?:
Code:

root:x:0:0::/root:/bin/bash
Remove that X, then when you login next time, you'll have NO password. Be VERY SURE to create one after you get back in:
passwd

HTH

Cool

jhogan 08-28-2003 08:57 AM

Lost password
 
You can also start to boot, hit 'e' (for edit) at the grub splash screen, on the next screen hit 'e' again on the second line.

Scroll to the end, type 'linux 1'. Hit enter, hit 'b' (for boot).

At the prompt:

[username] passwd

And enter a new one.

--jeremy (hogan)

jhogan 08-28-2003 10:22 AM

Woops
 
That should have been:

passwd [username]

in the lost password post.

shylesh 08-28-2003 10:24 AM

Hai friend,

if u had LILO as u'r bootloader press ctrlX when u'r asked to select the OS .Then type linux single at u'r boot: prompt.
I'll then enter into a command mode which as super user permission.There u can create user ya type the followin
echo "root:x:0:0::/root:/bin/bash" >>/etc/passwd
then reboot and login as root of no password after that u can change password

HappyDude 08-28-2003 12:32 PM

Put in your RH cds and figure out how to get into rescue mode. Follow the instructions and mount the partitions. open Emacs (or Vi) and open file /sys/image/etc/shadow.
On the first line should be root and should look like:

root:%^#$%&GB@4656B%%^:11922:0:999999:7:::

change it to:

root::11922:0:999999:7:::

That should work... I did it once in RedHat 8.

windowsrefund 08-28-2003 01:52 PM

just figured I'd mention tomsrtbt if you don't have your install cds (I always install over the network so I've never had cds). You can find the software at toms.net

Once you create the bootable floppy, make sure that your bios is set to boot off of the floppy drive. I can't remember the default login for tomsrtbt but the info can be found in the documentation. Once you're at a shell as root, you'll just want to mount your root partition, and either edit /etc/passwd (as mentioned above) or just run passwd yourself.

Best,
Adam

Skidlid 08-28-2003 06:22 PM

Thnaks everyone it worked LOL, thanks again:newbie:

Candy 09-22-2003 12:03 AM

For those of us who are new to linux it is not that easy, here i sit with a new LCD monitor that is out of range and i cant get to the video card setting to fix it easily and i dont have my user name or password so am understanding why windows users find linux so difficult, nothing is easy.... bummer i have been trying for hours. help

MasterC 09-22-2003 01:05 AM

:) Actually, it is ;) Let's take windowsrefund's example:
Go to toms.net and grab tomsrtb, follow the instructions on that site to create a bootable floppy from the image you get. Then, boot with that floppy. It will start a linux distro running from that floppy (amazing) and at that point you will need to mount up your root partition:
mount -t ext3 /dev/hdx /mnt/root

Where /dev/hdx is the device that your root partition is installed to. If you don't know what device that is, then, as root type:
/sbin/fdisk -l
And it will print out the info of your disk geometries. You can either try each device labled as "linux" type, or if you recognize it at this point, then mount up the correct disk, and follow one of the above instructions, OR, as windowsrefund said:
chroot /mnt/root
passwd
Enter the new password, exit, exit, reboot, and eject the floppy. You should now be able to login as root with that new password.

Cool


All times are GMT -5. The time now is 11:19 PM.