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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
11-28-2007, 09:18 AM
|
#1
|
Member
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324
Rep:
|
I lost root password.
Good Day,
Yeah, I lost root pass word on my linux(RH) machine.
I still have normal-user pass word. I can't much with non-root user account.
I was thinking starting machine with live cd and modify /etc/shadow file.
Any thoughts ?
Thank you.
|
|
|
11-28-2007, 09:31 AM
|
#2
|
Member
Registered: Nov 2003
Location: South Jersey
Distribution: Slackware, Raspbian, Manjaro
Posts: 826
Rep:
|
I think you can boot with a live CD, chroot to the root partition of your RH installation and then use the 'passwd' command as root. I'm pretty sure that will work for you...
|
|
|
11-28-2007, 09:33 AM
|
#3
|
Member
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324
Original Poster
Rep:
|
^ Thank you.
|
|
|
11-28-2007, 09:33 AM
|
#4
|
Member
Registered: Nov 2003
Location: South Jersey
Distribution: Slackware, Raspbian, Manjaro
Posts: 826
Rep:
|
Found this. Seems to be very straightforward and will most likely help you solve your problem.
http://www.linuxforums.org/security/..._password.html
If you look below the main write-up there is a comment by another person- "One More Thing" - that is indeed the way I first suggested...so I guess I was right.
Last edited by Vincent_Vega; 11-28-2007 at 09:35 AM.
|
|
|
11-28-2007, 09:40 AM
|
#5
|
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131
Rep:
|
As you would have noticed, if you had done a search before posting, there are already several threads about losing or "losing" root password, and answers to the question "how to get it back?" (well, you don't, but you can reset it).
Anyway, after this you'll hopefully understand why it's so easy to reset one's root password, and what to do at minimum to make it more difficult. The usual methods are as follows:
- booting into single-user mode (no live-cds needed); if you haven't set bootloader password, and are able to boot into single-user mode, a root login can usually be obtained without any passwords. passwd then changes the password..
- booting from a live-cd or connecting the harddisk into another machine will, unless the disk (or at least root partition) is encrypted, reveal the passwd and shadow files and enable basically anyone to erase the password field and have access to root account
- loose sudo configuration usually means you can get root login anyway, so unless your sudo configuration is nonexistent or very strict, that's a way to go too
Other methods exist, but those are the easiest.
|
|
|
11-28-2007, 09:44 AM
|
#6
|
Member
Registered: Nov 2003
Location: South Jersey
Distribution: Slackware, Raspbian, Manjaro
Posts: 826
Rep:
|
Well now this is just one more google link to LQ regarding lost root passwords!
|
|
|
11-28-2007, 09:45 AM
|
#7
|
Member
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324
Original Poster
Rep:
|
^ you thoughts on "Easy method" ?
From same page::
Code:
#linux single
This will make you the "root" user without asking for a password. Once the system has booted, you can change the root password using the password command:
Code:
# passwd
The instructions for GRUB users are similar. Press 'e' at the GRUB prompt to select boot parameters. Select the line for the kernel you want to boot, and go to the end of it. Add "single" as a separate word, and then press ENTER to exit the edit mode. Once back at the GRUB screen, press "b" to boot into single user mode.
|
|
|
11-28-2007, 09:48 AM
|
#8
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
If Red Hat is like Fedora core and when you use sudo you enter your regular users password, you could try "sudo passwd".
|
|
|
11-28-2007, 09:58 AM
|
#9
|
Member
Registered: Nov 2003
Location: South Jersey
Distribution: Slackware, Raspbian, Manjaro
Posts: 826
Rep:
|
Quote:
Originally Posted by knockout_artist
^ you thoughts on "Easy method" ?
|
Easy enough. Those steps are right-on. If you're using GRUB, you select your choice, press "e" to edit, add 'single' to the kernel line, press <ENTER>, and press "b" to boot. I have not done this myself but I have edited many grub entries at boot time.
Try one method and post back with your success or failure! We'll go from there.
|
|
|
11-28-2007, 10:01 AM
|
#10
|
Member
Registered: Nov 2003
Location: South Jersey
Distribution: Slackware, Raspbian, Manjaro
Posts: 826
Rep:
|
Quote:
Originally Posted by jschiwal
If Red Hat is like Fedora core and when you use sudo you enter your regular users password, you could try "sudo passwd".
|
This is actually a great way also! For the sake of simplicity, I definitely suggest using this method first. I see no reason why this will not work for you.**
Good idea, jschiwal!
(edit)
** unless of course you are not a privileged sudoer!
Last edited by Vincent_Vega; 11-28-2007 at 10:08 AM.
|
|
|
11-28-2007, 05:35 PM
|
#11
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Quote:
Originally Posted by Vincent_Vega
This is actually a great way also! For the sake of simplicity, I definitely suggest using this method first. I see no reason why this will not work for you.**
Good idea, jschiwal!
(edit)
** unless of course you are not a privileged sudoer!
|
Someone who isn't a member of the wheel group wouldn't need to change the root password.
I tried it, but I didn't actually carry through with it. I ssh'ed into an old Pentium III laptop I installed FC 6 on and tried it out. I got a "new root password" prompt, and then bailed. This might be different in RHEL. A member of the "wheel" group could be able to do this to the main "root" user. However, the main administrator would probably also have a regular account and be a member of the wheel group as well, so it wouldn't be hard to run "sudo passwd" to create a known passwd and then look in the logs and see who did it. Assuming the "wheel" member didn't hide his tracks.
Last edited by jschiwal; 11-28-2007 at 05:53 PM.
|
|
|
11-28-2007, 06:03 PM
|
#12
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
I should have thought out my last response better. If you have FC6 and you indeed have many users and different wheel users, that user could also remove the root users regular account from the "wheel" group locking the main administrator out. I think the fix would be to change a line in a PAM configuration so that the old root password would need to be entered first. This would make using "sudo passwd" to reset a forgotten password impossible however. So it really depends on how well you trust the "wheel" members. On a corporate server, if the wheel members are employee's the main administrator with physical access to the server could boot up in rescue mode, reset the root password the old school way and find out how need to be fired. If it were a remote server, then this convenience may need to be plugged.
Last edited by jschiwal; 11-28-2007 at 06:07 PM.
|
|
|
11-28-2007, 08:02 PM
|
#13
|
Member
Registered: Nov 2003
Location: South Jersey
Distribution: Slackware, Raspbian, Manjaro
Posts: 826
Rep:
|
So I assume RH and Fedora make everyone members or the 'wheel' group? You sort of lost me because being a privileged sudoer doesn't necessarily mean you're a member of any particular group. On my system, I can change the root password the way you suggested but I didn't bother putting myself into the wheel group.
Is that a standard for RH?
(edit)
...and has knockout_artist had any success with this? It's always nice to hear what everyone's help resulted in for those people who, in the future, have the same issue!
Last edited by Vincent_Vega; 11-28-2007 at 08:03 PM.
|
|
|
11-29-2007, 05:41 AM
|
#14
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
If you have this line in /etc/inittab:
# What to do in single-user mode.
~~:S:wait:/sbin/sulogin
Then Single User mode will ask for the root passwd.
|
|
|
11-29-2007, 05:44 AM
|
#15
|
LQ Newbie
Registered: Nov 2007
Posts: 22
Rep:
|
Hello,password lost
i installed WUBI and i forgot the username and password that are asked to enter in before logging to ubuntu desktop.
what is the differnce between root password and this password ?
|
|
|
All times are GMT -5. The time now is 08:26 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|