LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-18-2010, 06:07 PM   #1
ovod88
Member
 
Registered: Apr 2010
Posts: 53

Rep: Reputation: 15
How to recover root password


Hello. Im a newbie in Linux. But so far one problem has appeared and I dont think Im able to solve it by myself. So, I was trying to enter root account via command line but it turned out that I forgot my password. I figured out I need to enter LILO prompt during bootup and enter new password but the problem is I have Fedora 12 distro and it seems to have no LILO but GRUB. So I dont know how to stop Linux from loading and enter "LILO" or GRUB prompt line. help me to recover my password
This is the very first my post. So sorry for mistakes
 
Old 04-18-2010, 06:11 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Hello.

You may be able to change the password but the only way to recover the password may (and I do mean may) be to use john the ripper or some other crack.

For the most part you should not need admin/root password. Try sudo su and see what happens. It may ask for the user password.

Last edited by jefro; 04-18-2010 at 06:12 PM.
 
Old 04-18-2010, 06:16 PM   #3
ovod88
Member
 
Registered: Apr 2010
Posts: 53

Original Poster
Rep: Reputation: 15
Sudo doesnt work. It is another reason why I want to recover root password. Root password is required.
 
Old 04-18-2010, 07:30 PM   #4
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
The passwords in Linux are one way and are difficult to crack (depending on the length of the encryption key).
So, it's unlikely you could crack it. Your best bet is to change it.

Normally hitting escape as grub starts will get you the grub command line.

Once there edit the kernel line and add a '1' to the end of that line (I think) and with no quotes. If that doesn't work, try adding single to the end of the line. (1 says boot into run level 1, single user mode. Adding single has the same effect. I believe it depends on what kernel you have.)

If you get a command prompt, just use the passwd command to change the root password.

If, when you come up into single user mode, it asks for root password, try adding init=/bin/bash, then try changing the password.

good luck.
 
1 members found this post helpful.
Old 04-18-2010, 07:42 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Another way is to use the install media. Boot from that, then at the initial screen type

linux rescue

at the text prompt
It will then boot from the DVD and attempt to mount the HDD as a separate disk. You can then

chroot /mnt/sysimage

(iirc) and change the passwd.

Last edited by chrism01; 04-20-2010 at 08:35 PM.
 
Old 04-18-2010, 09:07 PM   #6
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
http://www.linuxforums.org/articles/...ssword_54.html
 
1 members found this post helpful.
Old 04-19-2010, 05:00 AM   #7
ovod88
Member
 
Registered: Apr 2010
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks. Everything works. But I noticed that everybody can access the grub prompt without any pronlems and change the root password. So new problem arised. How to set the pasword to enter grub prompt? I heard that I need to change something in LILO.conf for LILO. What about GRUB?
 
Old 04-19-2010, 05:11 AM   #8
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Quote:
Originally Posted by ovod88 View Post
Thanks. Everything works. But I noticed that everybody can access the grub prompt without any pronlems and change the root password. So new problem arised. How to set the pasword to enter grub prompt? I heard that I need to change something in LILO.conf for LILO. What about GRUB?
GRUB entries can be protected as well with GRUB password, so that whenever someone tries to edit the grub entries it will ask for password.

http://www.makeuseof.com/tag/how-to-...entries-linux/
http://linuxpoison.blogspot.com/2008...word-grub.html

Last edited by Sayan Acharjee; 04-19-2010 at 05:14 AM.
 
Old 04-19-2010, 12:26 PM   #9
ovod88
Member
 
Registered: Apr 2010
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks. Everything is working. All problems for now are solved.
 
Old 04-19-2010, 12:55 PM   #10
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
But I noticed that everybody can access the grub prompt without any pronlems and change the root password.
Always remember that if someone has, or can gain, physical access to your machine, then they can easily become root, even if you have password "protected" grub and/or your BIOS.

That's why banks and other institutions always keep their computers inside a locked and secured building.
 
Old 04-19-2010, 09:46 PM   #11
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,031

Rep: Reputation: 63
Quote:
Originally Posted by ovod88 View Post
Thanks. Everything is working. All problems for now are solved.
You can mark the thread as "[SOLVED]".This option is under the Thread Tools above.
 
Old 04-21-2010, 12:34 AM   #12
Karl Godt
Member
 
Registered: Mar 2010
Location: Kiel , Germany
Distribution: once:SuSE6.2,Debian3.1, aurox9.2+3,Mandrake?,DSL? then:W7st,WVHB, #!8.10.02,PUPPY4.3.1 now:Macpup
Posts: 314

Rep: Reputation: 45
grub >find (hd0,0)/boot/pressTAB

kernel (hd0,0)/boot/vmlinz-5.6.78-99 root=/dev/hda1 ro single init=/bin/bash
initrd /boot/inird.img-4.3.21-generic

gets to

.
Beginn: Running /scripts/init-bottom...
Done.
.
root @(none):/# passwd or passwd root
Enter new UNIX password:
Retype ..:
passwd: password updated sucessfully
root @(none):/#

honours to tommylovell and smeezekitty #6 for the link >http://www.linuxforums.org/articles/...ssword_54.html
(
More relaxing live in view !)
 
  


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
How to recover my root password? tahrenyie85 Linux - Newbie 11 01-03-2008 05:59 PM
How to recover the root password? hg7688 Linux - Software 3 07-25-2006 04:20 AM
Is there any way to recover my root password... deepu_ks Linux - Security 4 08-03-2005 11:41 AM
recover root password sophie Linux - Newbie 1 08-05-2003 08:19 PM
Recover Root password Dannyb Linux - Newbie 7 10-25-2001 01:04 PM


All times are GMT -5. The time now is 07:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration