|
|
Being 'root' ISummary:
Introducing 'root'Unix and its clones and derivatives, including Linux, have been designed as multi-user systems. This is inevitable since in the days when Unix was designed, personal computers simply didn't exist. A network structure consisted of a server, the mainframe, to which the clients connected via 'dumb' terminals. A centralized and shared resource requires someone maintaining it - the system administrator, also known as 'superuser', or 'root'. ~# echo $UID The file permissions system in Unix is programmed to restrict access for all users on system files, except for the user account (or accounts) which have the UID 0 in '/etc/passwd': root:x:<strong>0</strong>:0:root:/root:/bin/bash Since everything in Unix is done via real or virtual files, this means absolute control over the system. Using root Considered HarmfulIt is very tempting for users new to Unix-like systems, especially those who come from operating systems without a permissions system, to bypass this system restriction by logging into the 'root' account and staying there. While this may seem convenient at first, there are many good reasons you should get used to doing your everyday work on the system on a user account. 'root' is the administrator accountOK, this may sound lame at first, but hear me out. You can shoot yourself in the foot easily on every operating system. Operating system designers and implementers usually do their best to prevent you from doing that, but these mechanisms only work if you use the system how it was intended to be used. >"Here's another story. Just imagine having the sendmail.cf file in /etc. Now, I was working on the sendmail stuff and had come up with lots of sendmail.cf.xxx which I wanted to get rid of, so I typed rm -f sendmail.cf. * (Richard Eiger in comp.unix.admin) He wanted to type rm -f sendmail.cf.. The extra space expanded the command to "delete a file called sendmail.cf. and every other file in the directory ()" ... You are much more likely to damage a Unix system using it as 'root' than you are for example Windows 9x. Because the designers of Windows 9x knew that there were no permissions in this system worth speaking of, they invented other methods to protect you and your system. Not the Unix wayWhat's the point in using a different operating system when you just make it act like the one you already know? Apart from the fact that this strategy won't work anyway, what do you do if you're on a different Unix-like system and don't have the possibility to become 'root'? You will never feel at home as long as you don't accept that some things are done differently on Unix-like systems, and done differently for a reason, not just to annoy you (although it can pretty much look like that sometimes!) SecurityEvery person who has physical access to a Unix-like computer is able to gain root access, if he gets access to the file system (e.g. floppy disk, CD-ROM drive, USB device, internet), because he can edit the '/etc/shadow' file. In this file the password for all users is stored. It can easily be edited and set to a zero password ('*'). So for perfect security you will need to secure physical access to your computer. The summary is: only be root when it is absolutely necessary for the task at hand. Tasks Which Require root PrivilegesOf course, there are tasks which require 'root' privileges, but these are not everyday issues. What's more, when you use tools like the Mandrake Control Center, you will be prompted for the 'root' password automatically if you are not 'root'. And there are other tools which allow you to assume and drop 'root' privileges whenever you need to. These will be discussed in the next item. Generally speaking, there are only two tasks which require 'root' privileges:
Next Item: su, kdesu and sudo Related Resources: Revision / Modified: Feb. 11, 2002
|