Preface

So: you’re a relatively new Linux user. You’ve got Linux installed, you’ve managed to log in, do some web browsing, send and receive email, and—now what? Although you can handle some of the basics, you feel like you’re flying blind: you know you’ve got lots of really powerful stuff at your fingertips, or at least so your Linux guru friend told you, but how do you make it do tricks? What’s there, and how does it work? What’s this thing called grep that they’re always talking about? How do you Samba? And where’s the #$%^ documentation?

The Linux-Unix world is abundantly documented. No, really! You can always find an answer, if you know where to look. The problem, of course, is knowing where to look. There are man pages, info pages, READMEs, HTML manuals, and the code itself. You don’t have to be a programmer to unearth useful bits in source code, because the comments often tell you what you need to know.

There are thousands upon thousands of online communities, one (or more) surrounding nearly every bit of software in the Linux universe. Nearly every program, no matter how small, has its own user mailing list. Every Linux distribution has its own mailing lists and user forums. There are forums and lists and Usenet groups for every computing subject under the sun.

And of course there are books and magazines of every description. So the real problem with Linux documentation is not the lack of it, but finding the bits you need without having to embark on a lengthy, heroic quest.

1. Audience

This book is aimed at folks who want to know what button to push. Understanding the underlying theory is useful, but if you can’t make the darn thing work, not very helpful. So it’s light on theory and heavy on how-to-make-this-go, with detailed, step-by-step instructions. I’ve included many references to additional resources.

Readers should have a bit of Linux experience. You don’t need to be a guru, but you should have some familiarity with the basics of booting up and shutting down, starting applications, Web surfing, and poking around the filesystem. You should know how to find and use the command line, as well as work in a graphical environment. You should understand that Linux is a true multi-user system, and that you use an ordinary unprivileged user account as much as possible, and that you only invoke root when you really need to.

This book assumes that you are in charge of a PC or LAN, and can acquire rootly powers when the occasion calls for them. You might be a power user who wants complete control of your Linux box, or a home user who wants to run a personal web or mail server, or set up a small LAN. Perhaps you are a Windows system admininstrator who has suddenly been ordered to “do Linux,” and you need to know how to set up Linux servers for Windows clients. Maybe you want to add Linux servers to an existing network. You might need to integrate Linux and Windows desktop users on a LAN.

Or you have no need for Windows at all, and just want to learn Linux system administration.

2. What Is Included/Omitted

Given that there are thousands of software packages to choose from, almost all of which do something useful, it was a foregone conclusion that I couldn’t cover everything. Or even most of everything. I decided what to include, and what to leave out, based on my opinion of what a fundamental Linux skill set should include. (You may have different ideas.) I included programs that I consider to be the best-of-breed, such djbdns, GRUB, Apache 2, vim, and Postfix. And I didn’t neglect old standbys like LILO and BIND.

You’ll find some excellent, innovative scripts for:

  • Adding users in batches

  • Changing passwords in batches

  • Finding all the installed documentation for a program

  • Finding orphaned libraries on RPM-based systems, and adding them to the RPM database

I decided not to include productivity and desktop applications, like Open Office, KMail, Firefox, Konqueror, the Gimp, GnuCash, and so forth. This book is about building infrastructure. Once you master the fundamentals of running and maintaining a Linux system, it will take you anywhere you want to go.

3. Platforms

There are more Linux distributions than can be counted; there are literally thousands of distributions, many of which are peculiar to a company, a campus, or even a circle of friends who like to roll their own. However, the world of distributions breaks (not very cleanly) into two large camps: RPM-based systems, represented in this book by Red Hat and Fedora, and apt-based systems, represented by Debian. Debian-based distributions are spreading like weeds, such as Knoppix, Xandros, Libranet, Unbuntu, and Linspire.

Even if you are using a distribution that does not fall into one of these two categories, such as Slackware or Gentoo, the fundamentals are pretty much the same. The kernel is the same; the programs and utilities available are the same; the window managers are the same; the only substantial difference is the way you install software.

That’s not to say there aren’t other differences between Linux distributions. A chronic bugaboo with Linux is differing file locations on different distributions. Get used to it; it’s not going to go away. This book provides several excellent methods for finding out where your particular distribution puts configuration files, executables, and program documentation.

4. Conventions

The following typographical conventions are used in this book:

Italic

Used for filenames and pathnames, hostnames, domain names, commands, URLs, and email addresses. Italic is also used for new terms where they are defined.

Constant width

Used for code examples and fragments.

Constant width bold

Used for user input.

Constant width italic

Used to indicate text that is replaceable.

Tip

Indicates a tip, suggestion, or general note.

Warning

Indicates a warning or caution.

One particularly important convention in this book involves the use of command line prompts. I can’t say it too often: don’t get into the habit of su’ing to root whenever you have to do anything remotely administrative. Even worse, don’t say “It’s my machine, I can do anything as root.” Use root privileges only when you really need them. You’ll be safer that way; you’ll have some protection against your own mistakes, and against attacks made by outsiders.

To show you when you need root privileges, commands requiring root privileges are preceded by the root prompt, #. Commands that don’t require root privileges are preceded by the default bash shell prompt, $.

Don’t be confused—there are many file listings in the book, and in many of these files, comments are preceded by #. Yes, it can be confusing, but you’ll get used to it.

5. Downloads and Feedback

Doubtless this book, despite the heroic efforts of me and the fabulous O’Reilly team, contains flaws, errors, and omissions. Please email your feedback and suggestions to , so we can make the second edition even better. Be sure to visit http://tuxcomputing.com for errata, updates, and to download the scripts and configuration files used in the book.

This book was authored entirely in Open Office Writer, on Libranet Debian 2.8.

6. Comments and Questions

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
(800) 998-9938 (in the United States or Canada)
(707) 829-0515 (international or local)
(707) 829-0104 (fax)

There is a web page for this book, which lists errata, examples, and any additional information. You can access this page at:

http://www.oreilly.com/catalog/linuxckbk/

To comment on or ask technical questions about this book, send email to:

For more information about books, conferences, software, Resource Centers, and the O’Reilly Network, see the O’Reilly web site at:

http://www.oreilly.com

7. Acknowledgments

Thank you to ace O’Reilly editor Michael Loukides, whose good taste, eagle editorial eye, patient endurance, and implacable insistence made this a much better book.

Thank you to ace technical reviewer Jenn Vesperman, and her attention to detail. Silly computers are completely literal, and must be fed precise input—thanks Jenn!

Many thanks to Akkana Peck, Jenn Vesperman, Paul Heinlein, and Peter Samuelson, whose contributions appear in this book. Heartfelt thanks to the gang at Linuxchix, including Jenn Vesperman (benevolent dictator of Linuxchix), Dancer Vesperman, Danamania (the camera does not lie), Colby, Evilpig, Almut Behrens, Andrew (Mandrake Guru), Hamster, Piglet, Val Henson (uppity rabble rouser), H. Peter Anvin (kernel guru and rabbit rouser), Rik Rose, Devdas Bhagat, David North (for comic relief), Telsa Gwynne, Maria Blackmore, Meredydd Luff, Kai MacTane, and Erinn Clark (for more uppity rabble-rousing). Linuxchix rawks!

I’m sure I missed some folks who patiently endured my endless pestering. Tell me who you are, and I’ll fix it in the second edition.

Get Linux Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.