LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-08-2020, 09:31 AM   #1
LegionOfHell
Member
 
Registered: Jul 2020
Posts: 41

Rep: Reputation: Disabled
What does running things as root do ?


If I run a GUI app, command line app or X as root, What problems would it cause ?

Is it just the home folder ownership change or are there other things I should worry about too ?
 
Old 08-08-2020, 09:47 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,843

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
here you can find some info: http://wiki.linuxquestions.org/wiki/Root_user
 
Old 08-08-2020, 11:05 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
You certainly don't want to access the internet as root. There's not a lot of malware written for Linux but anything that you did pick up would have root privileges.

The main problem with being root however is that you can accidentally wipe parts of your system just by mis-spelling something in a command. One great difference between Linux and Windows is that Linux users are actively encouraged to explore their systems and find out where everything lives. This is safe precisely because you can't damage anything if you are not root. In Windows, you can't find out how anything works, not only for reasons of commercial secrecy, but simply because it's usually too dangerous to look around and you are strongly discouraged from trying.
 
1 members found this post helpful.
Old 08-08-2020, 07:51 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I second what hazel said. A little background.

Linux was written to Unix standards. Unix from the beginning was a multi-user system; multiple users could connect to the same mainframe computer from terminals either directly or over modems (in the early 70s, I had a coworker who would access a remote mainframe via a modem, which, in those days, was a cradle in which he rested his office telephone).

Putting a wall between the all-powerful administrator (that is root, as the root of a tree) was a security feature to prevent users from inadvertently (or advertently) damaging the system. (The sudo command was originally created so that users who had a compelling need to access certain administrative functions could do so; sudo was never intended to be used as a proxy for root.)

To build on what hazel said, if you connect to the internet as root and accidentally import malware, the malware will have root privileges, that is, access to your entire system. If you accidentally import malware as user, the malware will be restricted to user's home (and any other directories to which user has write privileges), thereby limiting its ability to do harm.

Last edited by frankbell; 08-08-2020 at 07:53 PM.
 
2 members found this post helpful.
Old 08-08-2020, 11:27 PM   #5
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
What does running things as root do ?

In short, running as root allows everything to run with all privileges. Errant processes and unauthorized users will have full access to the system. If you don't know what you're doing, you will not be stopped from doing inadvertent damage while logged in as root.
 
Old 08-09-2020, 04:28 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by frankbell View Post
in the early 70s, I had a coworker who would access a remote mainframe via a modem, which, in those days, was a cradle in which he rested his office telephone.
I remember those! We used to call them acoustic couplers. You rang a certain number and there was this weird warbling sound. Then you put the handset into a padded box and you had a connection.
Quote:
If you accidentally import malware as user, the malware will be restricted to user's home (and any other directories to which user has write privileges), thereby limiting its ability to do harm.
But I remember a thread (maybe not on this forum) which pointed out that on a home system, the data in your home directory is often much more valuable that what's on your root partition. After all, you can always reinstall the system if it really becomes necessary. A short-lived worm that ran in your name and deleted your personal files would do a lot of damage if you didn't have a proper backup policy in place. The point of not going online as root is that permanent malware could be installed in your system which will then do damage on an ongoing basis. That can't happen if you are an unprivileged user.
 
Old 08-09-2020, 04:47 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Additionally, you might get permission or rather ownership problems on files and/or whole directory structures as a result. If you do this in combination with a "normal" user it can create quite a mess, and things can break in unexpected places.

I must admit that CLI advice given on forums often does not include a marker when it needs to be executed as root. This can lead to the erroneous impression that all CLI commands are "better run as root" with some newbies...
So, all you power posters, be precise!
 
Old 08-09-2020, 09:48 AM   #8
masterclassic
Member
 
Registered: Jun 2007
Distribution: Knoppix, antiX
Posts: 252

Rep: Reputation: 73
Quote:
Originally Posted by hazel View Post
But I remember a thread (maybe not on this forum) which pointed out that on a home system, the data in your home directory is often much more valuable that what's on your root partition. After all, you can always reinstall the system if it really becomes necessary.
Data are always valuable in home or professional systems because the system works for them.
A difference is that a professional production system or business server can't be out of work for long. The damage for the business can be very bad. I did experience such situations in my job (windows server). What the IT "rescue" technician tried to do was to have another secondary server machine working from an older backup drive as soon as possible, in several hours, so that the system is barely working for the next few days, during main server's restore from backups.

For a home system a delay of a few days isn't perhaps so important. Loosing data without backup can be very annoying.

Last edited by masterclassic; 08-09-2020 at 09:49 AM.
 
Old 08-11-2020, 02:11 AM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by hazel View Post
I remember a thread (maybe not on this forum) which pointed out that on a home system, the data in your home directory is often much more valuable that what's on your root partition.
Relevant: https://xkcd.com/1200/
 
1 members found this post helpful.
Old 08-11-2020, 06:43 PM   #10
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by ondoho View Post
Except that it misses the point by trivialising the issue. Admin level access allows far more than the just installation of drivers.

The separation of the user from the system means that the actions of the user cannot take the entire system down. This was the big fundamental flaw with pre-XP versions of Windows... and was the reason why switching to the NT architecture (which [poorly] mimics the Unix model) was basically inevitable. Remember the Blue Screen of Death? It could be induced by simply choosing the wrong theme in Windows 98, or by plugging in a USB scanner. That sort of thing stopped happening with Windows XP, precisely because it separated the user from the system, and this is perhaps why it is so fondly remembered by the people who were initially subjected to Windows 95/98/Me.

Admin access can also be used to install rootkits, "bots" of a million different kinds, and all sorts of malware. Of course, these can also be installed at user level... but at that level they cannot bring harm to the system. Yes, a user might lose data, but losing 1 user's data is better than losing 100 users' data and having the machine become a spambot for the V1agra sellers without your knowledge. This is the reason that the "black hats" (for want of a better phrase) are continually seeking privilege escalation and will use whatever means necessary to obtain it.
 
1 members found this post helpful.
Old 08-11-2020, 08:06 PM   #11
KGIII
Member
 
Registered: Sep 2015
Location: North-Western, Maine - in the mountains.
Distribution: Lubuntu 18.04 LTS
Posts: 158
Blog Entries: 6

Rep: Reputation: 64
Quote:
Originally Posted by hazel View Post
We used to call them acoustic couplers.
Yup, that's what we called them. A long, long time ago, we'd use 'em to dial into other computers - not necessarily mainframes but things like BBSes or even friend's computers. At one point, I had a regular cassette player that was used as a data storage device. A friend would call me and play his tape(s) while I recorded them in an early form of software piracy.

One of my local BBSes, as I was fortunate in locality - situated in Cambridge, Massachusetts, had a grand total of 12 telephone lines so we could have many people signed in simultaneously. Today, even if they know, most younger folks won't even know that MODEM is supposed to be in all caps, as it stands for MOdulation and DEModulation.

Man, computers were a pain in the butt back then. And expensive... I remember *celebrating* when RAM reached the price of $1/MB. In my basement, I still have a Trash 80 with a few working floppies - one of which has Zork on it. I've got a VIC 20, but the power brick is dead and gone.
 
Old 08-11-2020, 08:34 PM   #12
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool

Quote:
Originally Posted by LegionOfHell View Post
If I run a GUI app, command line app or X as root, What problems would it cause ?

Is it just the home folder ownership change or are there other things I should worry about too ?
Quote below from this link: https://www.debian.wayoflinux.com/in...of-sudo-and-su

Rule of thumb, use root only when needed.

Don't use root for any operations that doesn't need it such as browsing the internet and the like.

Or even browsing your files at the local drive, because if you suddenly need to use "rm" it will gladly execute the command and delete the files and it will suppress the permission denied to permission granted.

Quote:
Some of the pros and cons of both approaches

Pros of using a root account:

Separate password -- A separate root password can in many cases be a lot safer. It can be longer and more complex than your normal password since you'll need to use it less often.
Separate account -- When a user gets hacked, the hacker does not automatically get access to root privileges (via sudo).
Easier to differentiate between admins and users -- Admins can have all the access they need, while users will not have anything beyond what's reasonable.

Cons of using a root account:

Separate password -- It can be inconvenient to have to remember two passwords, especially on a home computer.
Separate account -- With an enabled root account, a hacker knows exactly what to target. On a multi-user system, if only one user account has administrative privileges, they might have a harder time figuring things out.
Easier to differentiate between admins and users -- Same as above. A hacker will instantly know what to target.
 
Old 08-12-2020, 01:46 AM   #13
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by rkelsen View Post
Except that it misses the point by trivialising the issue.
You are absolutely correct - it's a cartoon!
Nevertheless, the point hazel made is important, but it is not to be misunderstood to "trivialise" the importance of having restricted permissions in the first place.

Last edited by ondoho; 08-12-2020 at 01:49 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 5 things I like in Ubuntu 11.04 (Unity) and 10 things which I don't LXer Syndicated Linux News 0 05-02-2011 12:30 AM
LXer: Getting Things GNOME - Useful Tool to Get Things Done! LXer Syndicated Linux News 0 12-07-2010 05:40 PM
LXer: The bug reporting culture: 10 things to avoid, 10 things you can do LXer Syndicated Linux News 0 01-21-2008 02:10 AM
Suse: confused on many things, why is installing things so hard? blackflare Linux - Newbie 11 10-16-2007 04:35 AM
LXer: Things found on the way to other things. LXer Syndicated Linux News 0 01-06-2007 08:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration