Possible Duplicate:
Concern about logging in as root overrated?
I often hear that it's a bad idea to use root for general use. Why is this a bad idea?
Possible Duplicate:
Concern about logging in as root overrated?
I often hear that it's a bad idea to use root for general use. Why is this a bad idea?
Summarizing from this Ask Ubuntu answer, it is a bad idea to run as root because:
You are much more prone to mistakes or software bugs. That program which deleted files as a bug? If it ran as a limited user, at most it can damage stuff in your home directory and on a few other devices (e.g. USB disks).
If ran as root, it might have freedom to delete everything in the system. Besides, you might be the victim of a buggy script which accidentally deletes critical files.
Similarly, a vulnerability or malicious software can cause much more harm, because you gave it full permissions. It can change programs in /bin
and add backdoors, mess with files in /etc
and make the system unbootable etc...
You can be victim of your own stupidity. That rm -rf *
you ran by mistake, or if you swapped input/output device in dd, would be stopped by your lack of permissions, but if you run as root, you are all powerful.
You don't need it for most uses, except for administrative work.
sudo
has similar dangers, but at least they will not (at least they should not) happen by accident - if you typed sudo destroy_my_machine
you presumably knew well what would happen, it's very hard to believe one could do it by accident.
For an example of something quite nasty, assume a script that runs rm -rf $someDir/*
; if $someDir
isn't set, the end result is rm -rf /*
.