LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is there a secret to loging in as "root"? (https://www.linuxquestions.org/questions/linux-newbie-8/is-there-a-secret-to-loging-in-as-root-868141/)

debcam 03-12-2011 10:06 AM

Is there a secret to loging in as "root"?
 
I have a Debian system on which I have installed "root" as a separate user, as probably most people do, and I have specified a password which I am sure I remembered well, because when the system occasionally asks me for that password for certain specific tasks, there is no problem. The problem occurs when I try to LOG IN as "root", and there is nothing on earth I can do to convince the login screen that I am indeed "root". Now I know I have the right password, I have the right CAPS and everything, so the only thing left I can think of is that I am not giving the right user name. Is there a special way to identify yourself as "root"? I remember when I was taking Novell classes there was a way to specify a user using "$" (example: $root$ ), or maybe there is a trick of some sort, do I have to use capitals, or a capital R? Right now I am just thinking of reinstalling and eliminating Mr. Root because I can't do anything with him. Have I missed something obvious?

MS3FGX 03-12-2011 10:13 AM

You aren't supposed to be logging in as root. If you need root-level permissions, use sudo. If you feel you absolutely must have long-term access to the root account, then you can switch over to root from the command line with the "su" command.

But you don't log in directly as root, especially not though the GUI.

repo 03-12-2011 10:14 AM

Do you want to login in the GUI ?
Root can't, and shouldn't login in the GUI.
Login as a user and use su to do admin tasks

Kind regards

johnsfine 03-12-2011 10:21 AM

As you see in replies before my reply, the usual advise is do not login to a GUI session as root. That might be good advise. I don't happen to agree with it nor follow it myself. But I don't want to argue about it.

It should be your choice. Knowing that this might be a bad idea, you still should be able to learn how to do it. It appears that two or more independent settings might be blocking root GUI login, so you might need to do more than one enable action. Two that I found on a quick google search were:

Quote:

To permanently enable root login to gnome under Debian, edit the
/etc/gdm/gdm.conf file.
In the [security] section of the file, add the following line:
AllowRoot=True
and

Code:

sudo passwd -u root
I don't recall exactly which two re enables of root GUI login I needed in KDM/Mepis when a Debian security update took away the root GUI login previously allowed by Mepis. Those were not exactly the two I quoted above (so I haven't tested what I quoted), but since you aren't using Mepis, my finding the exact Mepis instructions I followed wouldn't really help you.

In Linux, I never read email nor visit even trusted web sites as root. That is just my opinion of reasonable precautions. I don't want to argue that these might be either necessary or sufficient precautions for someone else.

glidermike 03-12-2011 03:30 PM

Well, one thing you can do is open a root terminal applications-accessories-root terminal (password required) then type in "nautilus" you can then poke around your system using the nautilus file browser with root access. Of Course if you delete or modify a file you had better know what you are doing or you will be pooching your system!

frankbell 03-12-2011 06:26 PM

On my Debian, at the login screen, I can click Actions at the bottom of the screen and select "Configure the Login Manager." Somewhere under one of the tabs, there is an "Allow local administrator login" checkbox.

jefro 03-13-2011 01:14 PM

It is really the hot plate deal. You get burned on it once and you will never do that again.

I just can't believe that anyone would not follow best practices at all times. (since I was burned) A best practice is a task or function that helps protect data. Log in as root is considered a security risk. While it is simple to do on some distros, more hardened systems will now not allow it. The best practices you learn and use will be simple enough to do on test boxes so that you are not tempted to do it later.

brmccarty 03-13-2011 01:49 PM

I have had many tell me that it is a bad idea to log into a gui as root. That said I have done it on occasion to avoid typing in the password repeatedly if I am making changes that require root privileges. To do this in Slackware I simply type root for the user name and enter the password.

debcam 03-13-2011 10:50 PM

Hi. I'm the guy who asked the question in the first place, and I have to thank everyone for their generous contributions of ideas. I have solved my problem in another way since then, for I have decided to re-install my Linux system on a separate machine where I will feel free to experiment with it at will without being afraid to crash it. For me, logging in as root is a necessity since I don't have enough knowledge of THE_CODE to be able to wreak havoc on my machine through the terminal only. I need to have big tools in my incompetent hands. I was actually trying to delete a Linux partition from within Linux, and of course, it was defending itself. I eventually made it from within Windows, and of course I wasn't able to start Linux after that. But that's not a problem, my files were very well backed up, and I simply re-installed Debian, and life goes on. What happened to taking risks in this world? What's the use of owning a system if you can't feel free to crash it once in a while? Anyway, like I said, I must thank you again, and the next time I have another irresponsible idea, I'll know where to look for support.

tommcd 03-14-2011 01:32 AM

Quote:

Originally Posted by debcam (Post 4289820)
I need to have big tools in my incompetent hands. I was actually trying to delete a Linux partition from within Linux, and of course, it was defending itself.

If you want an easy to use GUI tool for managing partitions, check out the Parted Magic live CD: http://partedmagic.com I have used Parted Magic to create, delete, and resize partitions. It is quite reliable as well as easy to use.

Partitions need to be unmounted before you can mess with them. That is why it was "defending itself".

Alternatively, you could just open a terminal from within Debian, then use
Code:

su -
to become root. Then unmount the partition (as long as it is not the root partition that you wanted to delete). Then use cfdisk to delete the unwanted partition.
You then may have to edit your /etc/fstab to make sure each line in fstab is still pointing to the correct partitions.

brmccarty 03-25-2011 11:03 PM

Quote:

Originally Posted by debcam (Post 4289820)
What happened to taking risks in this world? What's the use of owning a system if you can't feel free to crash it once in a while? Anyway, like I said, I must thank you again, and the next time I have another irresponsible idea, I'll know where to look for support.

That's why I use me old P III to experiment with. I don't depend on it so if it gets crashed no big rush. Although been using it quite a bit the last couple weeks. Haven't had time to fix my Windows 7 that recently crashed.


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