Linux - NewbieThis 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.
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.
I found a few people asked "How can I login as root on debian?"
but never seem to get straight answer. Why is this? If it has
been impossible to do so then should be said so? If it is still
possible then why not give the straight answer? Could anyone
here give us the answer?
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Sure.
There are three ways, (1) if there is a root home directory (which usually would be /root), you can simply log in with userid "root," enter the root password, and there you go; (2) use sudo (in which case you don't log in as root but become a temporary super-user; (3) use su -, enter the root password, and there you go.
Here's the rub -- if you don't know the root password (and are not an approved "sudoer," you ain't goin' anywhere.
Here's the other rub: RTFM for su and sudo so you'll an understanding of what goes on and why (if you don't know what FTFM means, try wft rtfm).
I found a few people asked "How can I login as root on debian?"
I'm not sure how the actual Debian does it ... But I have a distro built on Debian, and to login as root is simple:
__________________
Username: root
Password: *******
__________________
It had me set up the root at install. As in I choose the password ... And then had to setup another user so I wouldn't always be on root.
Maybe it is like the Ubuntu root, which you have to edit the sudousers, log on through terminal with a command (I think it is gksudo, but I am to lazy to verify that right now), enter password twice, and then you can log as root. ||-Please note I am paraphrasing here, this is FOR SURE not 100%-||
I don't think any distro would make it impossible to log in as root ... I am still pretty new, so I don't know how correct this is or if it helps, But I hope it did. Good luck.
I think the OP means logging in as root to the GUI, which is disabled by default in Debian. That people in most cases get no straight answer to this is, in my opinion, because those people mostly seem to be not aware that logging in as root to a GUI can be a real security risk. Many people, especially newbies, seem to want to be root because they:
1. Do not know how to start graphical applications as root.
2. Don't understand the use of su or sudo.
3. They are annoyed of typing their password/root's password, because they didn't have to do that on Windows.
IMHO, in this cases it is better to explain the security risks and how to avoid them instead of giving a plain answer and endanger their systems with that.
Most distributions disable root login via the desktop (i.e GUI) by default because it is not recommended for security reasons and also not safe practise.
Isn't there the 'keyring'? You type the pass and get access ... Or is root just not allowed to enter at all-and why?
Yes, the keyring will help with that issue, but is not installed per default in all distros, and you will have to type in your password at least once, which seems to be too much for some people.
Quote:
How so? Isn't the point of being root to be able to access everything, if and when needed? what security issue could arise?
At first, the problem actually is that you are able to access anything as root. Any malware will also have access to anything. And there is the problem that you will be allowed to change anything in the system. If you try that as unprivileged user you will not be allowed to do that. This way you will recognize that you are accessing a system file, which is a thing to think twice about.
Have a look at this forums, in the last weeks I remember at least four threads where people "accidentally" deleted necessary files (sometimes whole folders) or changed all permissions in a system folder (and sometimes in the whole system) to 777. Both renders the system unusable or at least unbootable and would have been avoided when the user would work as unprivileged user. that way he would have given an error message or at least a password dialog, which every time should be a thing to make someone to think twice about the wanted action.
So it's just a way for the system to say 'don't jump on that bed, You could break your head'? ... Preventative measures just to warn that it is important for operation? <<(these are not real questions, rhetoric ... It just looks like the punctuation that belongs)
So it's just a way for the system to say 'don't jump on that bed, You could break your head'?
If we're talking analogies, I think it would be more accurate to say something like, "Don't eat the pillow. You may get indigestion."
Logging in to a full-on DE (desktop environment) as root means every single program you run will be executed as - root. Your word processing application, your audio player, and that big, buggy monstrosity referred to as a web browser all run with enough privileges to damage your system. Totally unnecessary and dangerous. (Kind of like eating a pillow. At least jumping on the bed is fun.)
I found a few people asked "How can I login as root on debian?"
but never seem to get straight answer. Why is this? If it has
been impossible to do so then should be said so? If it is still
possible then why not give the straight answer? Could anyone
here give us the answer?
The short answer to your question: LinuxQuestions.org is not a private one-on-one support forum. Even if you say "tell me how to log in to GUI as root, I am aware of all the security risks, please give me the straight answer and spare me the security lecture," I must assume that other people will read the archived thread, who might not have your level of security expertise, and therefore I feel obliged to give a general-purpose answer that is fit for public consumption.
Another way to look at this is that once you understand linux well enough not to be a security risk (to your system and others) you will not need to ask the question. This will be for two reasons. First Linux follows very logical patterns and once you have a good working understanding of those basic patterns you can usually figure out how to do most things faily easily. Second, once you reach that stage, you will understand that there is no reason(excluding extremely rare cirumstances) to ever need to login as root(gui).
1) Because there is no real reason to login to Gnome/KDE as root.
But to do it all you need to do is change a setting in gdm/kdm.
Some of us find it easy to work as root access instead of sudo. To permanently enable root access to your Debian/Gnome desktops edit the /etc/gdm/gdm.conf file. In [seurity] section Allow root by setting the value to True. Once you’re done with it, you need to reboot or just restart the gdm for the change to take effect.
Here is the sample configuration: (You can also find remote root access settings)
[security]
# Allow root to login. It makes sense to turn this off for kiosk use,
# when you want to minimize the possibility of break in.
AllowRoot=true
# Allow login as root via XDMCP. This value will be overridden and
# set to false if the /etc/default/login file exists and contains
# “CONSOLE=/dev/login”, and set to true if the /etc/default/login
# file exists and contains any other value or no value for CONSOLE.
AllowRemoteRoot=true
The settings are also in the GDM and KDM GUI.
Or for kdm edit /etc/kde4/kdm/kdmrc
Never had a reason to login to the desktop as root in the seven years I have ran Debian.
For opening apps like pcmanfm/konqueror/dolphin etc as root, that is what gksu/sux/sudo are for.
I fail to see why it is so difficult to type a root password to do these things. Why are people so lazy that typing a password is so hard for them to do?
Never had a reason to login to the desktop as root in the seven years I have ran Debian.
And I have hosed a Debian system by logging into the desktop as root. Looking back on the experience, I really wish I had been more patient and learned the correct way to administer the system. But Debian led me to Ubuntu and Ubuntu led me to Kubuntu, where I have found happiness and prosperity until now (long may it last!).
Which brings another thought to mind. Windows traditionally gave all users the equivalent of root access. It wasn't until the NT family that any distinction was made between users beyond simple desktop customizations. It wasn't until Vista that Windows began prompting before performing potentially risky operations, and many Vista users' solution was to disable even that.
People coming from Windows are accustomed to having automatic administrative rights. Instead of telling them how to hose their systems, it might be better to gently educate them about some of the differences between the two systems.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.