LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-03-2011, 10:01 PM   #1
hishii
LQ Newbie
 
Registered: Oct 2004
Distribution: Fedora Core 16
Posts: 25

Rep: Reputation: 0
Unable to login as root while I can use the su command


Hi,

I have a Linux machine which I set up for my personal use at home. I installed Fedora Core 11 a long time ago, and recently I noticed that I am not able to log in as root (I didn't realize this issue until recently since I always have been logging in as a user account that I created during the FC11 installation).

When I login as a user account instead of root, I can use the su command with the password I set up for the root account. Even when I'm in GUI mode and try to make changes to the system from the user account, the GUI asks to enter the root password, and I type the password I set for root and it works. However, if I boot the machine and try to log in the system as root, password that I set up is rejected.

I'm very puzzled with this problem because with my limited knowledge on Linux system, I thought the root password and the su password are the same (i.e. when you install Linux OS, you set the root password, and you use the same password for using the su command). I do not know exactly when this problem started, but the only thing that I can think of as a cause of this issue is that I once changed the root password from GUI using System > Administration > Root password since the system one time complained about the low security strength of the root password.

Could anybody advise me for resolving this issue? Is there any file where I can see the password for the root account? Thank you in advance.
 
Old 04-03-2011, 10:12 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
On fedora, you enter in your own password for sudo. This has the advantage where you can allow some users to use sudo, but don't need to give them the secret root password. If you are the only user, you could simply change your password to match root's or vice versa so there is one less password to remember, using the "passwd" command.

The hash for the root account is in /etc/shadow. It is a hash of the password (and salt) and not the password itself. The password itself is not stored, but when you enter the root password, the system reshashed what you entered and compares that with the entry in /etc/shadow.

You should not be logging in as root anyway. Administration programs will ask you for the root password when you run them. Other gui programs can be launched as root using kdesu (in kde) or gnomesu in gnome. Most of the time, tasks needed to be performed as root, will be done in the console.

Last edited by jschiwal; 04-03-2011 at 10:14 PM.
 
1 members found this post helpful.
Old 04-03-2011, 10:14 PM   #3
Mr. Bill
Member
 
Registered: Mar 2011
Location: Maryland, USA
Distribution: Xubuntu 14.04 - 64
Posts: 185

Rep: Reputation: 14
Here's an illustrated tutorial for recovering/changing the root password in Fedora. Hope this helps.

http://www.go2linux.org/fedora-cento...sword-recovery
 
1 members found this post helpful.
Old 04-03-2011, 11:55 PM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
You cannot login as root directly. The system won't permit it via a graphical login. This is a feature.
 
1 members found this post helpful.
Old 04-04-2011, 08:55 PM   #5
hishii
LQ Newbie
 
Registered: Oct 2004
Distribution: Fedora Core 16
Posts: 25

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by smoker View Post
You cannot login as root directly. The system won't permit it via a graphical login. This is a feature.
Thank you for your comment. I didn't know about this. Now I changed the inittab value to 3 and confirmed that with CLI mode, I can log in as root with the password I set up. Once I'm in GUI mode, I am not able to log in as root. As jschiwal pointed out, it is probably better off not logging in as root since in the GUI mode, the system always asks root password when I need to make the necessary system-related changes.

One thing, though, keeps me thinking about the situation I was in, which triggered this posting... I recently bought a video PCI card for my Linux machine. Then, this PCI required its driver installation. I did this in CLI mode, logging in as an user account with the su command, not as root, then after installing the driver successfully, I restarted the machine and logged in as the same user account (not as root) in GUI mode. Then, I needed to modify the video configuration to optimize the use of multiple monitors. This process required to save the configuration settings to /etc/X11/xorg.conf. Since I was in the GUI mode, a Save As dialog appeared. I browse to /etc/X11 and tried to save the settings as xorg.conf, then the system complained that I don't have permission to do it. So, my next move, as a newbie, was to log in to the system as root in GUI mode, make the video configuration changes and save the settings to the xorg.conf file, which I couldn't.

I wonder what I should have done in this case. Would you suggest to change the xorg.conf permission with the chmod command? I ended up opening the xorg.conf file while I was still in GUI mode by launching vi in terminal window, then manually typed the changes in the xorg.conf file, which was rather time-consuming.

See what a newbie is doing when he/she is desparate?
 
Old 04-04-2011, 10:38 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
the first thing you might want to do is back up everything and install the current version of fedora
Fedora 14

Fedora 11 and fedora 12 are NOT supported any more !
and fedora 13 will become unsupported in about 3 months ( aprox 90 days)

the problem you had with saving the xorg.conf was you used " su" and NOT "su -"
there is a VERY big difference in those two commands

1)
fedora sets the system $PATH and user permissions to THE NORMAL USER with "su"
2)
fedora sets the system $PATH and user permissions to THE ROOT ACCOUNT with "su -"

fedora 11 has not had any updates to it in a year , and NEVER will .The repos with the OLD rpms are disappearing from the net as they get deleted to make room for the CURRENT fedora 14 and 15-alpha-testing
 
Old 04-05-2011, 02:18 AM   #7
hf2046
Member
 
Registered: Mar 2011
Distribution: Slack64
Posts: 111

Rep: Reputation: 20
Quote:
Originally Posted by hishii View Post
See what a newbie is doing when he/she is desparate?
As you learned, vi and emacs are still necessary every once in a while - even for newbies. I don't boot into a graphical environment precisely for the reasons you list above - what if my video settings change and/or they get screwed up from a bad driver install?

Time to take the next step and learn how to use the shell... you won't be sorry.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to login as root after source command executed Neo_1983 Red Hat 3 11-17-2009 03:26 PM
root and users unable to login in command mode- RHEL 4 pragabalu Red Hat 1 07-25-2009 09:22 AM
root and users unable to login in command mode- RHEL 4 pragabalu Linux - Newbie 3 07-25-2009 05:41 AM
root and users unable to login in command mode- RHEL 4 pragabalu Linux - General 1 07-25-2009 01:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:13 PM.

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