Because Mac OS X is based on Unix, a user account called root exists on every Mac OS X machine. The root account has permission to do everything that is possible; the root account permissions go way beyond even the administrator account permissions. Because of this, logging in under this root account is very powerful, and it is also dangerous because it isn't that hard to mess up your system, delete directories (whether you intend to or not), and so on. However, because you sometimes need to log in under the root account to accomplish specific tasks, you should understand and become comfortable with it.
You should be logged in under the root account only for the minimum time necessary to accomplish specific tasks. Log in, do what you need to, and then log out of root again. This minimizes the chance of doing something you didn't intend to do because you forgot you were logged in under root.
Be careful when you are working in your Mac under the root account. You can cause serious damage to the system as well as to data you have stored on your machine.
The root account is a very special user account, but it is still a user account. The full name of the root account is System Administrator, and its short name is root. One difference between the root account and other accounts is that the root account exists without having to create it. However, you have to activate the account and assign a password to it before you can begin using it.
You can activate the root account and create a password for it by following these steps:
Log in to the Mac.
Open the NetInfo Manager application found in the Applications/Utilities folder (see Figure 8.13).
NetInfo Manager is a very powerful system administration application; to learn more about it, see "Using the NetInfo Manager to Administer Your Network," p. 848.
Authenticate yourself as an administrator by clicking the Lock icon and entering user account information for an administrator account. (You have to do this even if you are logged in under an administrator account.)
Select Security, Enable Root User to see an alert explaining that the root password is currently blank; this is not a good thing.
Click OK to close the warning. The Set Root Password dialog box opens.
Type the new password for the root account.
Type the new password a second time in the "Retype new root password" box.
Click OK or press Return.
Enter your admin password in the resulting Authenticate dialog box and click OK.
Quit the NetInfo Manager application. Save you changes if prompted to do so.
After you have activated the root account and created the root password, you can log in under the root account by performing the following steps:
Log out of the current account.
Log in under the root account. If the login window is configured to show user accounts, select Other on the list and then enter root, type the root password, and click Login. If the Login window just shows the User Name and Password fields, enter the root account username and password and click Login.
Confirm that you are logged in as root by opening the Home directory; root appears as the username and as the label of the Home folder in the Places sidebar (see Figure 8.14).
If you enable Fast User Switching, the root account isn't listed on the Fast User Switching menu. To log in to the root account, you must bring up the Login window by choosing Login Window on the Fast User Swtiching menu each time you want to log in as root.
Because the root account has unlimited permissions, you can add or remove files to any directory on your Mac while you are logged in under the root account, including those for other user accounts. You can also make changes to any system file, which is where the root account's power and danger come from.
Use the root account only when you really need to. Make sure that other people who use your Mac do not know the root password; otherwise, you might find yourself with all sorts of problems.
You can also log in to the root account directly in the Terminal window to enter Unix commands using the command line. This can be a faster way to enter a few commands if you are comfortable with the command-line interface.