Do most people just run a linux desktop as root?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Windows XP's security is pretty weak, I can usually bypass it just with flaws in GUI provided options, depending on how restricted things are. It seems to handle security in a black-list type of way, anything is allowed until it's been explicitly disallowed, and there's more than one way to access files on a computer.

However, I don't think the same applies to Vista and beyond.


No, nothing has changed with regards to NTFS ACLs from XP to Vista. There were some gotchas like creating a new filesystem would default to Everyone/Full Control but that doesn't apply to the system drive since those ACLs are setup during installation.

If you're an admin you can take ownership and put new ACLs on the files to give yourself access but that doesn't count since you're an admin already.
 

Red Squirrel

No Lifer
May 24, 2003
68,493
12,624
126
www.anyf.ca
I'd be willing to bet that most viruses don't infect because of exploits, but because of dumb users. A user browses to a web site and clicks yes to whatever message pops up and gives the virus permission to infect the system.
I'd say it's very rare to a virus to just mozy through scanning ports (or whatever the attack vector is), find an open one, exploit a security hole, and infect a system, I'd bet 99% of the time, it's the user's fault.

Yeah, but technically if said user was not admin it should not infect the whole system, but it does anyway. There are lot of viruses that do use security exploits in IE too. I remember making a VM for kicks with IE6 and just doing google searches for random stuff like warez. Without ever actually executing or saying yes to anything I landed with about 600 or so spyware infections just by going on bad sites. Keep in mind, this was like IE 5.5 with no patches, I should try it with IE 6, then 7 then 8 to test improvements, would be interesting.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Which, you know, have holes in them. ;)



Do you have a source for your numbers? I'd bet that the attack general vectors for Linux desktops are similar to Windows. Browser? Check. Email? Check. Users? Check. Bad administration? Check.

With a properly setup Windows system you can avoid a lot of the issues people see today (bad defaults).

I'd put money on the general attack vector on linux being focused at servers and not at desktop users. There are not enough desktop users to even bother (See the mac argument). However there are tons of linux servers out there that are misconfigured and ripe for the taking. This means tricking the user who configured the server and not exploiting a flaw in say libc.

For example, lets say I configured apache to run as root, and have a php script that is written poorly and allows code injection. I use this to take over your website and put my own malware up for windows users to download. This is not a flaw in apache, linux, mysql, etc. It's a flaw in the user not knowing how to properly configure those systems. Just like a windows user running as admin and executing every single exe that shows up in their mailbox.

This is different then say a exploit in the image rendering in IE. That allows you to trick the system into executing code, that is a flaw in the OS. While I am sure there are flaws of that nature in linux, they would not be the wise attack vector for most malware creators. There simply is no useful market. I have tried very hard for about 5 minutes to find a list of known linux malware. Beyond http://en.wikipedia.org/wiki/Linux_malware I have come up short. Try that with windows.

That said, finding a restricted user exploit could be used to trick that user into giving up privileged information to access root. An example would be writing a piece of malware that pretends to be software the user already uses and prompting for the root password to perform an application update. Or creating a script that gets aliased to be called instead of sudo that pretends to do sudo and tells you your password was incorrect, then it stores the password for the real malware, deletes itself and and calls the real command you attempted to run. A less astute user could be fooled.

But that is no reason to run as root. Running as a restricted user greatly improves security, and it imposes almost 0 roadblocks to productivity (unlike say trying to be a limited user on XP which can cause problems with software that assumed you would always be admin). It also protects you from yourself.

Example:

I am root. I want to delete every file in the folder /home/me/mp3s. For some reason I type: rm -rf * and suddenly I realize I forgot to change into that directory. If I was root, I no longer have a working operating system. I hope you have backups. If I was a normal user I would start getting permission errors right away. Linux assumes that root ALWAYS knows what it is doing. There is no idiot button.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Yeah, but technically if said user was not admin it should not infect the whole system, but it does anyway. There are lot of viruses that do use security exploits in IE too. I remember making a VM for kicks with IE6 and just doing google searches for random stuff like warez. Without ever actually executing or saying yes to anything I landed with about 600 or so spyware infections just by going on bad sites. Keep in mind, this was like IE 5.5 with no patches, I should try it with IE 6, then 7 then 8 to test improvements, would be interesting.

And in your "tests" I bet you were running as an admin user. Try it again with a non-admin account and see what happens. The few malware cleanups that I've done this year all had users that were local admin and in that case it doesn't require any special exploits for things like AntiVirus 2009 to install.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
I'd put money on the general attack vector on linux being focused at servers and not at desktop users. There are not enough desktop users to even bother (See the mac argument). However there are tons of linux servers out there that are misconfigured and ripe for the taking. This means tricking the user who configured the server and not exploiting a flaw in say libc.
I was talking about the available attack vectors against Linux desktops. Whether it is a profitable and worthwhile target is another conversation entirely. :)

But that is no reason to run as root. Running as a restricted user greatly improves security, and it imposes almost 0 roadblocks to productivity (unlike say trying to be a limited user on XP which can cause problems with software that assumed you would always be admin). It also protects you from yourself.

I haven't had any problems running as a restricted user under either Linux or Windows XP.

Example:

I am root. I want to delete every file in the folder /home/me/mp3s. For some reason I type: rm -rf * and suddenly I realize I forgot to change into that directory. If I was root, I no longer have a working operating system. I hope you have backups. If I was a normal user I would start getting permission errors right away. Linux assumes that root ALWAYS knows what it is doing. There is no idiot button.

I can't think of a sysadmin that I respect that hasn't done something like that. ;)
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I haven't had any problems running as a restricted user under either Linux or Windows XP.

On our campus we routinely find applications professors want to have on the lab machines that will not run as a default restricted user. Typically we have to call the developer and figure out which folders to give the user permissions to write to. After that all is well.

It's a big pain in the ass. Fortunately, I think more developers are coming around to using the users home folders and not 'program files' to store user related data.
 

lxskllr

No Lifer
Nov 30, 2004
57,992
8,232
126
I wish Windows had sudo. I can't stand UAC, but I find sudo easy to use and intuitive. I seldom have to type a password, and when I do it's no problem. The only time it pisses me off is when I've hand typed a bunch of file paths and commands and forgot to ask for root, and it fails. I'm more used to the system now, so that very rarely happens anymore.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I wish Windows had sudo. I can't stand UAC, but I find sudo easy to use and intuitive. I seldom have to type a password, and when I do it's no problem. The only time it pisses me off is when I've hand typed a bunch of file paths and commands and forgot to ask for root, and it fails. I'm more used to the system now, so that very rarely happens anymore.

When that happens to me I press up, then home, then type 'sudo', then press enter :)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I wish Windows had sudo. I can't stand UAC, but I find sudo easy to use and intuitive. I seldom have to type a password, and when I do it's no problem. The only time it pisses me off is when I've hand typed a bunch of file paths and commands and forgot to ask for root, and it fails. I'm more used to the system now, so that very rarely happens anymore.

Windows has sudo, it's called runas. And on Vista/Win7 UAC is almost sudo, if you're an admin user you just need to confirm the action and if not you need to put a password in before it'll continue.
 

lxskllr

No Lifer
Nov 30, 2004
57,992
8,232
126
Windows has sudo, it's called runas. And on Vista/Win7 UAC is almost sudo, if you're an admin user you just need to confirm the action and if not you need to put a password in before it'll continue.

The problem is I don't always understand why Windows wants permission on occasion. I pretty much always know when I need it for Ubuntu. Windows security levels don't feel as clearly delineated to me.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I would love an advanced UAC that tells you exactly why the program needs admin privs.

Something like "X installer is attempting to write the following files to the blah directory".
 
Dec 23, 2009
6
0
0
I know it's not advised, but, how in the world does one cope with having to enter a password every bloody time an app is started? Even to do updates. Do people just normally run as root so they can actually access everything? If you were to get a Linux virus (not that there are a lot of them out there but I'm sure there are) it would bypass the security anyway, so is the argument pretty much moot? It's like in Windows whether you are admin or restricted user, if you go online and catch a virus, the PC is infected anyway.

Things like changing screen res are also very annoying if not under root. Can't even do it, have to make it generate the config file, then copy and paste it as root. To me this is very counter productive, I rather have full access to MY system.

I'm talking from a desktop perspective. Am I maybe just doing something wrong? I'm new to the world of Linux desktop. Playing with VMs at this point but I'd love to convert my main system when I feel that I'm ready.

There is no need to enter the "password" for each application. The need to enter the password is only needed is to do "Administrative" tasks. If you would learn to do those tasks from the "Command Line Interface" (even by running the GUI tools from the command line rather than the menu), those tasks can be done my running a terminal and then the command:
Code:
ssh -X -Y root@localhost
and then enter root's password. Then the commands run in that terminal until "exit" will be done while logged in as root (while the menus and any other terminals will be the common user). The idea is to enter root do you needed stuff and exit as soon was you can leaving all the usage being done by a normal user. I have been using Unix since 1974 and have never had a problem being a "normal user" and have become "root" only when needed and leaving that session as soon as I can.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
There is no need to enter the "password" for each application. The need to enter the password is only needed is to do "Administrative" tasks. If you would learn to do those tasks from the "Command Line Interface" (even by running the GUI tools from the command line rather than the menu), those tasks can be done my running a terminal and then the command:
Code:
ssh -X -Y root@localhost
and then enter root's password. Then the commands run in that terminal until "exit" will be done while logged in as root (while the menus and any other terminals will be the common user). The idea is to enter root do you needed stuff and exit as soon was you can leaving all the usage being done by a normal user. I have been using Unix since 1974 and have never had a problem being a "normal user" and have become "root" only when needed and leaving that session as soon as I can.

Uhh... if your system is using sudo just run `sudo su -` and if not just `su -`. Why on earth would you SSH to your localhost just to open a root shell? Root logins should be disabled over SSH anyways.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I don't have a single system that can login as root via ssh. That is the first thing I disable. I use "sudo -i" if I want a root shell for some reason.

Also, why forward X over ssh? you have gksudo at your disposal...
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
I don't have a single system that can login as root via ssh. That is the first thing I disable. I use "sudo -i" if I want a root shell for some reason.

Also, why forward X over ssh? you have gksudo at your disposal...

this and that. in addition to advising the OP of all people of allowing an absurd security hole....his handle is annoying as hell.