Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Linux systems it is widely considered a best practice using the root account only on occasions that necessitate administrative privileges, or disabling it altogether and relying solely on sudo to accomplish any task that requires elevated rights.

Now, while I can see the benefit of this mindset on an actual multi-user system, where the usage of the root account has the potential of catastrophic consequences for the data of every user of the system, and thus should be minimized, I don’t see any value in it on a single-user desktop system, since the real value here is of personal data which is fully available to the regular user account and thus vulnerable to accidents or attacks anyway. Safety of system files is not a real concern. On the other hand, having to request elevated rights for system administration is an obvious inconvenience.

Considering these, my question is whether there’s any other benefit of not using / any risk of using the root account as the primary user account on a single-user system.

share|improve this question
    
The answer to this will differ from person to person, because it is largely one of opinion and individual practice/application. –  Moses Oct 27 '13 at 1:39
add comment

closed as primarily opinion-based by Tog, mpy, Mokubai, Simon Sheehan, Moses Oct 27 '13 at 1:39

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

Not using the root account in your day-to-day activities is all about damage control. The applications that you use might have flaws in them. They may be exploitable or they may just crash under specific circumstances. If you are running as a normal user then most flaws that allow something malicious to "break out" of your application will only be able to, usually, trash your home folder. However, if you are running as root then an application flaw can allow your entire system to be hosed as root has permissions everywhere. Running as a regular user isn't a panacea but it provides an extra hoop for malicious or accidental damage to your file-system.

share|improve this answer
3  
I'd also add that the principle of least privilege (en.m.wikipedia.org/wiki/Principle_of_least_privilege) is a tenant of IT security... If you only NEED root privileges 5% of the time, then you should only be running with root privileges 5% of the time. –  BrianAdkins Oct 20 '13 at 18:01
    
Accidental damage is also a real possibility if you are running as root.*Do not* execute this command:"rm -rf /"You can be using tab-completion with the intent of typing a few letters after the "/" and tab to complete them but instead press Enter by accident.If you are a regular user then the command will fail.If you are root you just deleted your file-system no matter how fast you press Ctrl+C.Some versions of"rm"are compiled to recognize that specific command and disallow it but you can't rely on your specific distribution to save you from that example - not all of them have that protection. –  Bill Oct 20 '13 at 18:14
    
I’m a little confused here. I very intentionally covered this argument in my question. On my desktop system trashing my home folder is a disaster, because it trashes all my personal data. Trashing anything else, I don’t really care, because I can always reinstall the complete system. Protecting /etc but not protecting /home/me benefits me nothing on a single-user machine. Can you please elaborate your point in the light of this? –  Joó Ádám Oct 20 '13 at 19:49
    
That is a good argument and has been brought up many times. There is usually a fair amount of time and effort put into configuring the underlying system and that can be saved by not running as root. As preparing for any eventuality should be considered, regularly making back-ups of your user-information is also a good practice to go in hand with not running as root. –  Bill Oct 20 '13 at 20:08
    
@JoóÁdám: As a piece of generic advice, if accidentally deleting important data in your home directory is more of a calamity than having to reinstall the entire system, you should probably drop whatever it is you're doing immediately and get to work on some backups. –  Marcks Thomas Oct 22 '13 at 15:28
show 1 more comment

I bought a car just to drive around the block to the grocery shop. This is a quiet neighborhood, no one drives faster than 10 km/h. Why do I need to buckle up? Why do I need a working horn? Why do I need to make sure that my brakes are in good working order?

To answer your specific question, yes, indeed, you can construct a use case where it will appear that using root habitually does no damage. However, it will create bad habits which will come to bite you when you will be using a more conventional setup.

share|improve this answer
    
I don’t see how the presented use case, i.e. a single-user system is something artificial that must be „constructed”. I’m not sure what do you refer to when you say it will bite back later. Also, I think the more apt analogy would be having the snow chains up midsummer. –  Joó Ádám Oct 20 '13 at 16:49
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.