LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   logging in as root (https://www.linuxquestions.org/questions/ubuntu-63/logging-in-as-root-382525/)

M O L8ingN2dust 11-12-2005 04:37 PM

logging in as root
 
How do you log in as root in Ubuntu? It never asked me to set the root password, and the password I did choose does not work to login as root. Does it set some kind of default password?

Matir 11-12-2005 04:52 PM

Most modern distributions prevent direct logins as root. Instead, you should use the sudo utility to perform commands as root.

M O L8ingN2dust 11-12-2005 04:58 PM

Quote:

Originally posted by Matir
Most modern distributions prevent direct logins as root. Instead, you should use the sudo utility to perform commands as root.
This is the first distro yet that I have used that disallows that. If that is the case, that is pretty annoying! There are many things logging in as root is useful for. For instance, I have a home partition, and a root partition. If I want to resize my home partition I need to unmount it. I can't unmount it unless I log in as root, otherwise it will be "busy". Using sudo wont help me there.

Also, annoyingly enough, this distro seems to have only created 1 partition and a swap partition. That being the case, partitioning is effectively impossible.

aysiu 11-12-2005 09:39 PM

Quote:

Originally posted by M O L8ingN2dust
This is the first distro yet that I have used that disallows that.
Yeah, Ubuntu's unique that way--contrary to the post you were responding to. I haven't found a single other "modern" distro that prevents you from logging in as root.
Quote:

If that is the case, that is pretty annoying! There are many things logging in as root is useful for. For instance, I have a home partition, and a root partition. If I want to resize my home partition I need to unmount it. I can't unmount it unless I log in as root, otherwise it will be "busy". Using sudo wont help me there.
Actually, it will. You just type
Code:

sudo umount /home
Quote:

Also, annoyingly enough, this distro seems to have only created 1 partition and a swap partition. That being the case, partitioning is effectively impossible.
Did you have Ubuntu choose to automatically partition the entire hard disk? Yeah, I've heard it's bad about allocating space. That's why I always choose to manually edit the partition table.

As for sudo... at first I was annoyed with it when I started using Ubuntu, but it's really grown on me. You may want to read this explanation for why Ubuntu uses sudo--there are security and other considerations. I've also learned of some good workarounds that, once you get used to them, actually are more convenient than logging out, logging back in as root, logging out again, and logging back in as user.

For example, if you create a launcher with the command
Code:

gksudo nautilus
you can browse around as root within your user account temporarily. Once you close the browser window, you're back to being a regular user fully. Give it a shot. If you don't like it after a while, you can also enable root (see link above for more info on that).

duffmckagan 11-13-2005 07:48 AM

If you still like to have the root password set on your computer, you can use the passwd utility.

Type passwd root at the terminal, and set the root password.

But still, on a default basis, whenever starting any applications that require root previleges, Ubuntu / Kubuntu will always ask you for your password.

M O L8ingN2dust 11-13-2005 12:28 PM

What is Kubuntu? Is it Ubuntu with KDE interface rather then gnome? If so, I am on it!

aysiu 11-13-2005 03:45 PM

Quote:

Originally posted by M O L8ingN2dust
What is Kubuntu? Is it Ubuntu with KDE interface rather then gnome?
Yes.

number9 11-23-2005 07:51 PM

Code:

sudo passwd

christopher5 11-27-2005 02:04 PM

Go to System Admin -> Users and Groups; select Show All Users; select Root and click edit; type in password and verify

Go to Login Screen Setup; Under Secutiry tab, check Allow Root Login in GDM

and you're set

pixellany 11-28-2005 03:55 PM

Amen to everyone who says the Ubuntu "no root" thing is annoying.

Anyone who gives birth to a computer---ie the mother who sets up the SW--had better know how to be a responsible Admin, Root, whatever.

At least they dont prevent you from activating root.........

blankdev 11-28-2005 06:08 PM

Using sudo helps just as well and I think logging into root is far more annoying. Canonical/Ubuntu strongly discourages activating the root account and logging into it, not only because of the usuall 'it's not safe', but because some apps wont run on it (correctly) that way.

pixellany 11-28-2005 07:07 PM

Quote:

Using sudo helps just as well and I think logging into root is far more annoying. Canonical/Ubuntu strongly discourages activating the root account and logging into it, not only because of the usuall 'it's not safe', but because some apps wont run on it (correctly) that way.
If doing several things that require root access, it is FAR easier to type "su" and your password just once. Further, its often handy to log in to a graphical session as root so you can drag files around with the mouse. Dont know how to "sudo" in the GUI mode.........

Apps that won't run as root?? What's that all about? Examples?

blankdev 11-28-2005 07:31 PM

I usually do sudo nautilus, and if I must do many windows (for example two if I need to drag from one window to another), do CTRL+SHIFT+T and type it again, etc. etc.

Go to https://wiki.ubuntu.com/RootSudo and scroll down to 'Enabling Root' to find out what I meant.

aysiu 11-28-2005 07:55 PM

Code:

gksudo nautilus
is the proper way to do it, and it's far more convenient than logging out of user, logging in as root, making changes, logging out of root, and logging back in as user.

ninjabob7 11-28-2005 08:30 PM

I don't know what you guys are talking about. What version are you using? When I installed Breezy, the setup wizard asked for a root password, and I can login as root on the virtual terminals. I haven't tried on the graphical system yet.
However, I have had some problems with the GNOME sudo (at least I think that's the problem). When I click on the updates icon, it prompts me for my password, but then seems to quit when I enter it.

aysiu 11-28-2005 11:34 PM

Quote:

Originally posted by ninjabob7
I don't know what you guys are talking about. What version are you using? When I installed Breezy, the setup wizard asked for a root password, and I can login as root on the virtual terminals.
You can set up a root password in the "Expert" install. If you do a regular install, you will never be prompted for a root password (not in Breezy, Hoary, or Warty).

ninjabob7 11-29-2005 06:41 PM

Oops, my bad. I forgot that I used the 'expert' option. This time around, after screwing up my installation and reinstalling, I forgot to add expert and didn't get prompted. Good thing I read this thread; now I know how to do add the root password myself. :)

uasked4it 12-26-2005 09:50 PM

Go to:

System -> Administration -> Login Screen Setup

Click on the 'Security' tab.

Check the 'Allow root to login with GDM' checkbox

This should allow you to login as root from GDM.

Penguin of Wonder 12-27-2005 01:03 PM

Linux is great because it's safe. But if your constantly logging in as root your not using Linux the proper way. One of the reasons Linux is so safe is because you, by default, do not log in as root, but as "user." Unlike windows who will log you in as admin by default. With root or admin for windows folks privliages you leave your computer vunerable to attack. One of the first things I learned as a Linux newbie is not to actually log in as root but to use the sudo method. The guys in the Slackware forum love to jump on people for logging in as root. (I have been jumped many times :-D). So yeah the sudo method is safer and for the better if you want your computer to really demonstrate one of the true strengthes of Linux, its safety!!

uasked4it 12-28-2005 02:32 AM

'Penguin of Wonder':

I agree with you completely. I only provided the above solution because that's what they wanted to know. I don't think you should login as root, but it's good to know how your system works. Knowledge is power.

sumguy231 12-28-2005 06:16 PM

The sudo method is all fine and nice, but I prefer the old-fashioned way and feel personally responsible enough to not do anything stupid like graphically logging in as root. Is there any way to enable root without breaking the graphical admin tools (Which the Ubuntu FAQ claims will happen)? (Sorry if that's a stupid question.)
Edit: I suppose I could get used to it, except for one thing: Sometimes, it just doesn't work. For example, some sections in whatever the Kubuntu Control Center is called just do nothing when I attempt to enter administrator mode.

foreigner 01-08-2006 08:59 PM

Windows users are trying Linux,
 
and need to be able grow comfortable within it.
Those curious have their data secured on separate partition, and dual boot just to see what this Linux is all about.
So if these people were able to secure their data, able to download and install different distros to try them out and dual boot with Windows, they would feel offended by the fact that this distro they are just testing is holding their hands tight and don't even allow them feel like master of their own computer.
Eventually they feel like Linux is not all freedom, but even more restrictive, less customizable, and uncomfortable than Windows.

aysiu 01-08-2006 10:08 PM

Logging in as root is just too much extra work.

If you prefer to make root-like graphical changes, just create a launcher with this command for KDE
Code:

kdesu konqueror
or this command for Gnome
Code:

gksudo nautilus
It's a lot easier to do that than log out of user, log in as root, make changes, log out of root, and log in as user again.

As for the KControl "Administrator Mode," yeah, it's a little buggy. The way to get around that is to do
Code:

kdesu kcontrol
And Ubuntu does allow you to create a root user if you want--it's not limiting anybody or holding your hand. It's using a particular default. If you want to use something other than the default, you can, which is why there's an "expert install" mode that does let you create a root user.

https://wiki.ubuntu.com/RootSudo

Please feel free to name one thing that you can't customize in Ubuntu that you can customize in other Linux distros. Thanks.

ubuntulifestyle 01-16-2006 02:10 PM

You can also log in as root by selecting "safe mode" in the grub options...That logs you in as root...


Ubuntulifestyle

SlCKB0Y 01-16-2006 04:49 PM

Quote:

Originally Posted by Matir
Most modern distributions prevent direct logins as root. Instead, you should use the sudo utility to perform commands as root.


Yea.. name a few more then...


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