LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 09-23-2005, 06:17 AM   #1
muru
LQ Newbie
 
Registered: Sep 2005
Posts: 15

Rep: Reputation: 0
Forgot root password


Hi anyone out there help me with this...

I am using FC3. What if I forget the root password ? What can I do to change the root password and login to the machine ?

Thanks in advance
 
Old 09-23-2005, 06:40 AM   #2
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
Boot into the machine using a linux live CD (like for example, Knoppix).

When you're in, first you need to mount the root partition of your FC3 system to /mnt
e.g. mount -t auto /dev/hda1 /mnt where hda1 should be changed to where your root partition is (if you can't remember where it was, just try to mount all your partitions until you found the right one).

Then use an editor to open /mnt/etc/shadow; find the line that starts with "root" (usually the 1st) and remove all the characters between the first and the second colons (this is the encryted root passwd). Save and reboot into your FC3 system, you can now log in as root without passwd (just press enter for password). Now immediately change the root password to a new one!
 
Old 09-23-2005, 06:45 AM   #3
SkyEye
Member
 
Registered: Sep 2005
Location: Sri Lanka
Distribution: Fedora, MeeGo, Mint, Ubuntu, RHEL, CentOS, Debian
Posts: 426

Rep: Reputation: 36
You can either go through GRUB or use the 1st CD to boot to a rescue environment. To go through GRUB you need the GRUB password (only if you have one. If you can't remember it either then you have to use the other method)

First at GRUB select the entry you would boot, then press "e" (means edit).
Then you will be taken to a screen with several lines. Select the line containing 'kernel' and press "e" again to go into edit mode.
After the current content of the line add a space and append "1" and press escape. Then press "b" to boot (to run level one) from that settings.
You will be booted and taken to a prrompt with "#"
Type
Code:
passwd
and change the password, and remember it!

If this doesn't work or if it asks you the current password, tell us back. We'll see the otherways then. For a typical FC3 this would work.

Note: You can see a glimpse of what can be done with GRUB. That's why GRUB should use a password.

Last edited by SkyEye; 09-23-2005 at 06:50 AM.
 
Old 09-23-2005, 06:55 AM   #4
muru
LQ Newbie
 
Registered: Sep 2005
Posts: 15

Original Poster
Rep: Reputation: 0
To SkyEye

I see the following line

grub edit> kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/1 rhgb quiet

So where do I put that space and a 1?

Gee thanx for helping around
 
Old 09-23-2005, 07:01 AM   #5
muru
LQ Newbie
 
Registered: Sep 2005
Posts: 15

Original Poster
Rep: Reputation: 0
To SkyEye

I just tried the following

grub edit> kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/ 1

and that ended with a Kernel panic - not syncing: Attempted to kill init!

What now?
 
Old 09-26-2005, 12:37 AM   #6
SkyEye
Member
 
Registered: Sep 2005
Location: Sri Lanka
Distribution: Fedora, MeeGo, Mint, Ubuntu, RHEL, CentOS, Debian
Posts: 426

Rep: Reputation: 36
First, Sorry I took long to answer. I was away in the weekend.

So you say you are at this line

Quote:
grub edit> kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/1 rhgb quiet
Make it like this
Code:
grub edit> kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/1 rhgb quiet 1
And don't remove any existing content (as you did in the second posting). They are kernel parameters and other information required by you Linux system.

Last edited by SkyEye; 09-26-2005 at 12:40 AM.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forgot root password k1ll3r_x Suse/Novell 6 05-05-2005 03:37 PM
forgot root password ust Linux - General 5 07-03-2004 01:39 AM
I Forgot my root password Hamid Moradmand Linux - Distributions 4 06-02-2004 01:45 PM
Forgot Root Password Darthcoder Linux - Newbie 5 11-08-2003 03:23 PM
forgot root password samik_ban Linux - Newbie 3 10-16-2003 07:34 AM


All times are GMT -5. The time now is 09:39 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration