Unable to login as root while I can use the su command
Linux - GeneralThis 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
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.
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.
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.
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.
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?
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.