Log in as Root

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Re: Log in as Root

Post by marcus0263 »

leslie wrote:Hello people. Nice to be with you!

Just trying mint. By some amazing luck I managed to get my ATI card installed ok. Phew, lotta hassle with Ubunto based distros I believe? Anyway, top marks for a nice functioning distro. To my question -

I am trying to login as root/admin but apparently I can't do that from the login screen? What's up?. That's ok if I can get file access with a kinda Super User Mode editor, has mint got one? - Oh rather not use Terminal.

Cheers
Les
Mint is Ubuntu based and you need to use "sudo" and do root functions as needed. There really isn't any need to login as root and it's a security risk.
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Post by marcus0263 »

leslie wrote:Thanks marcus0263. I know the risks but I'm not used to not having this control. If there's a way to do it I would really like to know. If not, then how can I delete unwanted files/folders - like unused pre-installed wi-fi stuff that I don't use.
Open up a terminal and

Code: Select all

sudo su
Then do what you need to do. Get out of the M$ thinking that you have to login as Admin. Any Unix based OS all you need to do is "su" and do what needs to be done. Like I said, there really shouldn't be a reason to actually login as root.

But if you MUST just set a password for root

Code: Select all

sudo passwd
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

mintero wrote:Logging as root is not a good idea (for security reasons)
Only true for newbies who might be tempted to permanently work as root (BAD IDEA!!). But if you know what you do it's perfectly safe. And logging in as root is sometimes even necessary :wink: But again: For long as you know what you do .... :wink:
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Post by marcus0263 »

scorp123 wrote:
mintero wrote:Logging as root is not a good idea (for security reasons)
Only true for newbies who might be tempted to permanently work as root (BAD IDEA!!). But if you know what you do it's perfectly safe. And logging in as root is sometimes even necessary :wink: But again: For long as you know what you do .... :wink:
Disagree

I can't really think of a reason to log in with a GUI as root, I won't ever say never, but I really can't think of a reason other than laziness or n00bness.

What ever needs to be done can be done in a root term and if you must you can run the GUI app as root with tools like gksu and gksudo.
vonskippy
Level 1
Level 1
Posts: 9
Joined: Fri Dec 29, 2006 11:02 pm
Location: Colorado, USA

Post by vonskippy »

marcus0263 wrote:I can't really think of a reason to log in with a GUI as root, I won't ever say never, but I really can't think of a reason other than laziness or n00bness.
Sorry to disagree, but being neither lazy or a noob, I control what I do to my computers - not the other way around.

If I wanted my computer to babysit my sessions, I'd use Vista with it's oh so useless UAC.

I've avoided trying/using *buntu for a long time because I resent the implication that I'm too stupid to understand and safely use the root account.

Only because MINT is such a nicely packaged distro, with an active support community have I dropped FC6 off of my laptop and installed Mint 2.2beta (mainly because it supported my sound and widescreen display right out of the box without any unnecessary tweaking or mods).

First tweak (after moving the main panel to the top) was to install a real root account. After 20+ years using big iron Unix's, I do almost everything from the cli, and yes, I'm that lazy in not wanting to type sudo everything.

The advantage of Linux and it's numerous flavors and choices is variety, so I find it ironic that some people defend their personal choices by calling other people either lazy or stupid for not agreeing with their OPINION.
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Post by marcus0263 »

vonskippy wrote:<snip>
I do almost everything from the cli, and yes, I'm that lazy in not wanting to type sudo everything.

Code: Select all

sudo su
or if you need a real root environment

Code: Select all

sudo su - root
Why type sudo for everything?
Even easier why not create a root term and have it as an icon on your desktop? Why logout then login as root like the Microsoft world?
vonskippy wrote:The advantage of Linux and it's numerous flavors and choices is variety, so I find it ironic that some people defend their personal choices by calling other people either lazy or stupid for not agreeing with their OPINION.
Yes I'm expressing my opinion as I stated that "I couldn't think of a reason" and "I won't ever say never", take it at that and nothing more.

Lighten up dude ;-)

BTW - I started out with punch cards and cut my teeth on CICS, TSO, JCL, PROFS, etc.. But when I discovered HPUX and Solaris I fell in love, used to think Linux was nothing but a toy till about 3 years ago.
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Post by marcus0263 »

To make things easy just create an "Application Launcher"

Root Term

Code: Select all

gnome-terminal -e 'sudo su'
Root Shell

Code: Select all

gnome-terminal -e 'sudo su - root'
Now place it on your Desktop, Menu, or where ever you choose.
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Post by marcus0263 »

mintero wrote:I agree and for information gksu works in sudo-mode by default in ubuntu. (Everybody can verify it in the Configuration Editor, if they have activated this tool)
Sudo has limited privileges and does the work. Why take more risk? Sudo's 5 min grace period could be a flaw, but one can change it and here's how:

In the terminal: sudo visudo
Add this line: Defaults:ALL timestamp_timeout=0
Exit (Ctrl+X)
It asks if you want to save: so save to /etc/sudoers

In this way, sudo doesnt keep the password for 5 min (the default), but asks for the password every time.
So if you are performing an administrative task and at the same time you open another program which needs admin rights as well, sudo will ask for the password again. That means that a malicious program can't exploit the time during which you are using sudo.
Good post mintero

Further more on the subject of reasons why NOT to run X and a GUI Desktop as root is really rather simple. It just is not a good idea to run X11 and Gnome or KDE as root because they are very complex services using complex protocols. It is well known that complex programs are more prone to errors than simple and short ones. X11 and GUI environments are very complex programs, in size rivaling the Linux kernel or exceeding it. Granted, you may be safe if you run these logged into a full Desktop provided you are very careful and have all the latest patches and keep your software up-to-date. But this all adds up to a large risk factor, so it is just a lot simpler to not to login to a "root" Desktop and have X11 and GUI running.

I can't even remember when the last time I logged into a GUI Desktop (other than corporate servers) as root. There's a very simple solution to the annoying "sudo" everything, create an "Application Launcher" that launches into a root term. Why take unnecessary risks? Not to mention about the biggest annoyance I have with Microsoft windows is having to log out and then log in as "Administrator", the *nix way is so much easier and safer.

But again for those who "have to" just give root a bloody password, but Caveat Emptor!
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

marcus0263 wrote:Disagree.
Nope, in fact we agree. I wasn't talking about GUI logins but logging into the system as root in general, e.g. via shell, local terminal, whatever.
marcus0263 wrote: I can't really think of a reason to log in with a GUI as root
Dito. I wasn't thinking of this possibility.
marcus0263 wrote: What ever needs to be done can be done in a root term
That's what I said ... or meant to say.
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

vonskippy wrote:Sorry to disagree, but being neither lazy or a noob, I control what I do to my computers - not the other way around.
That's precisely why it is dangerous. If you login as root into e.g. GNOME or KDE and then open a file manager, and you drag the mouse around ... what if you by accident perform a drag & drop operation? You are in control, right. The computer will do as you say, it will move a bunch of files without asking you, without babysitting you ...

When I was a beginner back in 1996 did people tell me not to login into a GUI as root? Yes they did. Did I listen? No I didn't. And what happened to me when I clicked the wrong mouse button in the right moment over the right place at the wrong time? Read above. :lol:

Had I been an ordinary user in that moment nothing would have happened. The system would have given me a "access denied" error, and whatever stupid thing I was doing wouldn't have happened. But I was root ... and root's powers are unlimited and not to be questioned by that stupid computer ...

There are other security implications too when logging in as root, e.g. a bunch of stuff normally under non-priviledged ordinary user control all of a sudden enjoys the full powers of the root account ... and that can have bad consequences too, depending on what strange or funny things you (by accident?) set in motion ...

Regards,
scorp123
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Post by marcus0263 »

scorp123 wrote:There are other security implications too when logging in as root, e.g. a bunch of stuff normally under non-priviledged ordinary user control all of a sudden enjoys the full powers of the root account ... and that can have bad consequences too, depending on what strange or funny things you (by accident?) set in motion ...
Agreed -
The largest risk is what is running under the hood and giving unnecessary programs root access. Just look at that bloated desktop KDE for example. You know programs like Amarok that goes out into the cloud hitting different servers. People just need to play it smart and safe and to it the *nix way, the command line is simple and is your friend. All I do is click on my menu "Root" and a Root Term comes up and I do what ever needs to be done. Then servers I administer I just ssh in then su into a root shell and do what needs to be done. The KISS method is the best.

The biggest battle I believe is too many people are used to the sloppy Microsoft way. I always like to bring up the best example of Microsoft's sloppy design by asking "have you defragged today?" ;-)

Cheers
User avatar
Lolo Uila
Level 5
Level 5
Posts: 576
Joined: Thu Mar 15, 2007 3:40 am
Location: Kapolei, Hawaii

Post by Lolo Uila »

The issue for me when I see this question posted every week or so isn't the ol' whether or not you should log in as root argument; it's more like should we tell people that ask this question how?

As leslie discovered it's really quite easy to do in Mint, and when anyone has to ask for help with this I find myself wondering if they really are knowledgeable enough to use root safely. I was a complete noob and it took me less than 5 minutes to figure it out when I looked into it back when I first started using Mint.

As for the argument about "Mepis, Gentoo, Fedora, etc. let me do it", well then you are welcome to keep using any of those distros. No one is forcong you to use Mint. Mint is not a distro for hard core Linux fanatics. If you want maximum control over your computer and the OS I'd suggest Gentoo or Slackware.

Mint is targeted at new users and Windows converts, and as such is designed to be both simpler and safer to use. Nothing in Mint is a deep, dark secret, though. That simple philosophy even extends to things like enabling the root account and root login to the GUI. So instead of spending 10 minutes typing up a rant about why we should tell you how to do this, spend 5 minutes figuring it out for yourself.

Aloha, Tim

PS: Everyone really should take the time to learn how to use the terminal and command shell. GUI login as root is a bad habit to get into, and it's not something you should depend on (it won't help you fix things when your system won't boot).
User avatar
kenetics
Level 5
Level 5
Posts: 731
Joined: Thu Dec 14, 2006 9:57 pm
Location: Fort Lonesome, Florida
Contact:

Post by kenetics »

I know how to login as root, but without being in root how would one do something like adding XMMS skins to usr/share/xmms/skins? Or easily delete a bunch of unwanted wallpapers in usr/share/backgrounds (can only do 1 at a time in Desktop Background menu)?
z0phi3l
Level 1
Level 1
Posts: 11
Joined: Wed Sep 26, 2007 8:32 pm
Location: Mechanicsburg, PA

Post by z0phi3l »

After 2 quarters of my Linux instructor bashing into my head to never log into the ROOT account, I've found simple as firing up the terminal and "sudo nautilus" to do anything like large deletions of crap etc, other than that I'm happy using the CLI to do most admin tasks.
User avatar
kenetics
Level 5
Level 5
Posts: 731
Joined: Thu Dec 14, 2006 9:57 pm
Location: Fort Lonesome, Florida
Contact:

Post by kenetics »

"sudo nautilus" works well. Thanks.
exploder
Level 15
Level 15
Posts: 5546
Joined: Tue Feb 13, 2007 10:50 am
Location: HartfordCity, Indiana USA

Post by exploder »

I do not as a habit log in as root with the exception of Mondo Recovery. Mondo will not create a proper backup unless I am logged in as root. Mondo will go through the motions using sudo but the backup will be worthless.
dracorX

hehe

Post by dracorX »

Graphical Root access is the root for disaster ;-)

No joking around anymore, I do have graphical root access configured as well. I use it quite often: twice per year hehe.

Sometimes, for very specific tasks, I rather login graphically than somehow different.
hannu
Level 1
Level 1
Posts: 19
Joined: Wed Jan 07, 2009 11:32 pm

Re: Log in as Root

Post by hannu »

leslie wrote:Hello people. Nice to be with you!

Just trying mint. By some amazing luck I managed to get my ATI card installed ok. Phew, lotta hassle with Ubunto based distros I believe? Anyway, top marks for a nice functioning distro. To my question -

I am trying to login as root/admin but apparently I can't do that from the login screen? What's up?. That's ok if I can get file access with a kinda Super User Mode editor, has mint got one? - Oh rather not use Terminal.

Cheers
Les
There are ways to login as root, but it may be also important to actually take over the root account. This is usually necessary for production servers etc. where you the administrator has the root account and others do not.
By default, desktop style Linux distros do not offer the root password to be set during the original installation, but allow the user to have sudo privileges.
This is how you take over the root account if you are a normal Mint/Ubuntu user with the sudo option:
sudo passwd root
- the system will ask first for your password, then prompts you to set (change) the root password.
Once you have set (changed) the root password, don't forget it. You can then disable the sudoing options in /etc/sudoers.
Now you can become root at will, just type:
su
Operating a Linux system as root is not as dangerous as some people say. Don't delete files or change settings unless you know what you are doing. For many server systems, almost all setups, reading log files, adding users, etc. have to be done as root, so what's the point of sudoing all the time.
sudo is equally as dangerous. What if you by mistake add sudo users who all can do the above?
Hannu
User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Log in as Root

Post by Fred »

Many in this thread are confusing the pros and cons of using the sudo system and the traditional root - user password system with logging into a X session as root.

Starting a X session as root is wrong in almost every instance, regardless of how you do it. I haven't felt the need to do that in years. There are better, more secure ways of doing anything that you think you need a root X session for. It isn't a matter of you being in control of your computer. It is in fact the opposite. Running an X session as root means that you don't know enough about your system to do it correctly. You have given up control of your computer to the world, if you are or have been connected to the internet, in an attempt to do something that you don't know how to do correctly. You have actually given up control, not taken control. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
phonecian
Level 1
Level 1
Posts: 8
Joined: Tue Nov 03, 2009 8:18 am

Re: Log in as Root

Post by phonecian »

First, its great to find these threads so easily in the Forum. The issue is - predictably - a big one.

After reading through the contributions, I'm moved to comment too. I came to Mint recently after being a long time user of Xandros (also Debian) and Mint's lack of root user login (to perform network configurations etc.) is driving me nuts. It would be ok to sudo into root (as some have suggested) and configure through VI if, - just if - , VI was even as minimally intelligent as I remember it used to be years ago. But it isn't. For reasons as mysterious as string theory, its been 'updated' so a careless key touch now automates it right back out of its edit mode leaving characters scattered, lines spaced and so on - all to be patiently reworked again and again. An OS that, in the 21st century, still can't offer an easy graphical configuration interface its designers consider 'safe' is - in my view - already somewhat obsolete.

I like Mint in all other respects so I'm pressing on to see if I can make it work as I like an OS to work. But as I try to work it out I can't escape a sense of deja vue. Wasn't it Microsoft who put the secrecy into operating systems forcing users to adopt a mindless 'out of the box' mentality? Wasn't that the reason I came to hate Windows in the first place?
Locked

Return to “Other topics”