Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-21-2008, 02:32 AM   #1
LQ Newbie
Registered: May 2008
Posts: 24

Rep: Reputation: 15
Smile How to get the Root password

Dear Friends , I have forget my Fedora OS root password.i dont know the user password too i am not able to enter my fedora os. So if anybody knows the method please let me know .
Thank you

Last edited by anupamjamatia; 08-21-2008 at 02:35 AM.
Old 08-21-2008, 02:35 AM   #2
LQ Newbie
Registered: Aug 2008
Location: Sydney, Australia
Distribution: Fedora21
Posts: 22

Rep: Reputation: 0
the default passwd is just <enter. .. oe blank, unless you set it
If you did set it, and have forgotten it, there's bad news.
a re-install is needed.
Old 08-21-2008, 02:58 AM   #3
Senior Member
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 54
No reinstall needed - but a live-CD (or put the disk into another working system) to mount the filesystem and edit the passwd file (and shadow?).
If the file system is encrypted then you are out of luck indeed.

Last edited by jomen; 08-21-2008 at 02:59 AM.
Old 08-21-2008, 02:59 AM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If booting into single mode doesn't ask for the root password, you can run the "passwd" command.

Another method is to boot up with a rescue disk or live distro; mounting the root partition; and zeroing out the password field in /etc/shadow.

Because Fedora Core and I assume CentOS and RHEL also use LVM, you will need to mount the partition using the LVM device instead of the actual partition
mount -t ext3 /dev/system/rootvol /mnt/

Read the /etc/fstab file to get the name of device to use. The kernel should recognize the lvm members and assemble them and create a device node for you when you boot up.

After mounting the root partition on /mnt, cd to /mnt/etc/ and edit the /etc/shadow file.
Zero out the gibberish between the first and second colon. Then try rebooting, logging in as root (with no password), and running "passwd" to create a new password.


When I installed SuSE 11 on my laptop, I realized that I had somehow missed the part of entering the root passwd. When I tried to zero out the root password, the system would reject a login attempt. So I copied my regular user's encrypted password from /etc/shadow and used it for root. Then I was able to log in as root using my regular users password. However, you don't even remember that. You could copy a password hash from another system's /etc/shadow file.


There isn't a way to simply recover what the password is from the /etc/shadow entry, unless you brute force every possibility which could take a very, very long time.

Last edited by jschiwal; 08-21-2008 at 03:02 AM.
Old 08-21-2008, 03:25 AM   #5
Registered: Jul 2008
Location: Dar-es-Salaam
Distribution: Fedora,CentOS,Ubuntu
Posts: 60

Rep: Reputation: 15
Originally Posted by jschiwal View Post
If booting into single mode doesn't ask for the root password, you can run the "passwd" command.
I think single user mode is the simplest way to resolve password issues, as the root can login without a password, then from there you can reset your root password

single user:
while your machine boots, when you see grub press e for edit and arrow down to the kernel line

kernel /vmlinuz-2.x.xx-x ro root=[...]

- press e for edit and then add 'single' to that line, press enter and b to boot
- U're then in single user mode and u can change root password
sh-[...]#passwd root


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 could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 04:11 AM
Password Recovery in Edubuntu 7.04 - In Terminal, Root Login : su , password : ????? farhannaeem13 Linux - Security 3 11-30-2007 09:59 AM
change Root Password even if the password in the grub is also set sheelnidhi Linux - General 6 08-30-2006 07:27 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:46 AM.

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