LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 08-28-2003, 02:11 AM   #1
Skidlid
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Rep: Reputation: 0

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
 
Old 08-28-2003, 03:59 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Splitting out into it's own thread as this thread is for the introduction to this forum

Cool
 
Old 08-28-2003, 04:02 AM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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
 
Old 08-28-2003, 08:57 AM   #4
jhogan
Lulu
 
Registered: Jan 2003
Distribution: Fedora Core
Posts: 14

Rep: Reputation: 0
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)
 
Old 08-28-2003, 10:22 AM   #5
jhogan
Lulu
 
Registered: Jan 2003
Distribution: Fedora Core
Posts: 14

Rep: Reputation: 0
Woops

That should have been:

passwd [username]

in the lost password post.
 
Old 08-28-2003, 10:24 AM   #6
shylesh
LQ Newbie
 
Registered: Aug 2003
Location: Eranakulam
Posts: 2

Rep: Reputation: 0
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
 
Old 08-28-2003, 12:32 PM   #7
HappyDude
Member
 
Registered: Jul 2003
Posts: 140

Rep: Reputation: 15
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.
 
Old 08-28-2003, 01:52 PM   #8
windowsrefund
Red Hat Ambassador
 
Registered: Aug 2003
Location: NYC
Distribution: Debian, Redhat
Posts: 73

Rep: Reputation: 15
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
 
Old 08-28-2003, 06:22 PM   #9
Skidlid
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Thnaks everyone it worked LOL, thanks again
 
Old 09-22-2003, 12:03 AM   #10
Candy
LQ Newbie
 
Registered: Sep 2003
Posts: 1

Rep: Reputation: 0
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
 
Old 09-22-2003, 01:05 AM   #11
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
My browser Lost Saved Passwords rabeea General 2 09-07-2005 02:58 PM
Getting passwords back from Epiphany? slimjim Linux - Software 0 04-04-2005 05:41 PM
Lost Gui How do I get it Back Chancelor Linux - Hardware 1 01-17-2004 05:54 PM
How do I bring back lost items in K menu? ihr bist weasel Mandriva 4 01-07-2004 04:36 PM
password lost, need to get back files moeminhtun General 10 01-09-2003 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 06:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration