Chapter 18 for more information about the World Wide Web if you’re uncertain what it means.) Chapter 26 lists a number of other places to go Linux hunting on the World Wide Web.
The root of all UNIX
UNIX is a multi-user world, and that includes Linux: Lots of people can use the computer at the same time, by connecting from remote locations. The first thing you need to know about administering a Linux system is the difference between the user called root and every other user. Root (also grandly called the superuser) is the system administrator. This account has all the privileges to change things on the system. If you want to add users, install some software, or even turn off the computer, you must be logged in as root. If you’re logged in as someone other than root and you try to do anything related to system administration, your computer responds with a barrage of “permission denied” messages. It’s nothing personal. It’s just the computer’s way of telling you that in a multi-user environment, it doesn’t want just anyone messing around with it — only the one person it trusts, which is root.“Fine,” you say. “I’ll just log in as root all the time and not have to worry about running into those pesky permission problems.” Bad idea! Using the root account to do non-system-administration tasks is dangerous because sometime — eventually, when you least expect it — you type a command you really didn’t want to — oh, say, deleting all the files on the hard drive (it happens more frequently than you may think). If you’re logged in as someone other than root, the computer replies with a simple “permission denied.” If you’re root, though, the damage is done, and Linux (or any other version of UNIX) does not have an undelete command! Remember that permissions are your friends!
Adding a user
Assuming that you’re convinced about not logging in as root unless you really must, you have to add a user account for yourself (or for others) to use for everyday tasks. Suppose that you want to create the username bobbyjoe for yourself. To add this user, log in as root (because adding users is one of those special, privileged tasks that only root can perform) and at the shell prompt type the command adduser bobbyjoe . The computer creates the new user and then, if you’re lucky, reminds you to set the password for the new user. Whether or not the computer reminds you, you have to add the password by typing passwd bobbyjoe . Then enter the password when the computer asks for it. It asks you to enter the password twice, just to make sure that you typed it correctly.
Users who bring experience with other flavors of UNIX to their first encounters with Linux will probably find getting Linux up and running relatively easy. The large (and growing) community of Windows users who want to add or switch to Linux will likely encounter some fairly rough sledding.One of the great things about Linux is that it can run on PCs with Intel chips in them. Disgruntled Windows users can therefore switch to Linux without having to buy a new computer. Windows users who are still sufficiently gruntled can check out Linux by installing it, cheek by jowl, on the same computer with Windows (as long as it has enough free disk space, of course).All well and good, in theory. In practice, however, you can get yourself into trouble with startling efficiency. Even if it’s going to coexist on your computer with Windows, Linux needs its own separate file system, which in turn needs its own separate area of your computer’s disk. These separate areas are called partitions, or drives, and you have to have at least two partitions, one for Windows and one for Linux, to get Windows and Linux to live together in peace and harmony.If you have only one big drive or partition on your computer, you have to create a second partition before you can even begin installing Linux. To do so, you have to run a DOS utility named fdisk on your computer. The trouble with fdisk is that if you make one false move, everything that’s already on your computer gets wiped out, no questions asked. If you already have Windows installed on your computer, do yourself a favor and back up your system before even thinking about using fdisk . Then carefully follow whatever instructions you have for setting up a computer that can run both Windows and Linux (known as a dual-boot system). Linux For Dummies (mentioned earlier in this chapter), for example, describes the whole process in gory detail. If you already have Windows installed, you can also use Partition Magic, a popular (but not free) disk utility to repartition your hard drive without having to reinstall everything from scratch.
With some versions of Linux, your computer gives you remedial password advice if it thinks that you need it. If you create a user named noah and then try to add the password ark , your computer may say BAD PASSWORD: It’s WAY too short . If you try to fake the computer out by adding the password arkarkark , it may say BAD PASSWORD: it does not contain enough DIFFERENT characters . If you’re not sure what constitutes a good password, go back and read the section in Chapter 1 about password smarts. As a system administrator, you’re responsible for the security of the system, so don’t say that you haven’t been warned.
How do I turn this thing off?
UNIX and Linux are very sensitive to impolite treatment on the part of the operator. If you just log out and turn off the machine with the power switch, it reminds you of this rude treatment with a flood of error messages when you next restart the computer. To turn the machine off, you first must execute the shutdown command. While logged in as root, enter the command shutdown now to turn the machine off gracefully. If other users are logged in and you want to give them some warning, you can type the number of minutes until shutdown: shutdown +10, for example, waits ten minutes before shutting down and warns any users who are logged in. To reboot the computer, shutdown -r now (-r for reboot) shuts down the machine and then restarts it. Some Linux systems also let the "three-finger salute" (Ctrl+Alt+Del, familiar to DOS and Windows users) serve as a shortcut for shutdown -r now .