Forgot your password?
Operating Systems Books Media Software Book Reviews Linux

Linux Cookbook 126

Posted by timothy
from the something-burning dept.
norburym (Mary Norbury-Glaser )writes "Carla Schroder's Linux Cookbook (O'Reilly) is an extremely dense volume packed with valuable information. The author writes with precision and detail and with a conversational style that handles the topic with a wry humor making this book a pleasure to read. The Linux Cookbook is command-line based so some familiarity with a Linux system, the inherent power of using the command-line and the dangers of using root are necessary." Read on for the rest of Norbury-Glaser's review.
Linux Cookbook
author Carla Schroder
pages 700
publisher O'Reilly
rating 9
reviewer Mary Norbury-Glaser
ISBN 0596006403
summary Practical Advice for Linux Users and SysAdmins

The O'Reilly Cookbook series uses a problem/solution/discussion layout to deliver content in a "recipe" format. Schroder provides a thorough compendium of practical solutions to common problems found in the Debian and RPM-based Linux environments. Intended for the beginner to intermediate user, this book also has lots of good nuggets for the advanced Linux systems administrator. The table of contents generously lists each topic covered with enough detail for the reader to quickly pinpoint specific problems of interest.

The book begins with a logical chapter, "Finding Documentation," which naturally covers man (manual) pages: understanding, finding, reading and printing the documentation that has frightened many a newbie. The author includes references to other documentation (CHANGELOGS, RELEASE NOTES, etc.) and even some graphical viewers like Konqueror, Yelp and Pinfo. This chapter provides a nice overview of man pages and clearly explains how to find documentation quickly and efficiently.

Chapter 2 covers "Installing and Managing Software on RPM-Based Systems" and the introduction, "Source-Built Systems: The Olde Way", made me LOL. Schroder describes how "us old-timers" did it in the days before dependency resolvers; with failed makes and long download times. Having experienced my share of "Dependency Hell" and espousing more than once, "In my day....", I can take a cue and not only laugh at the past but appreciate the present. Schroder brings that to bear with her problems and solutions to "RPM Hell". Ahhh, the more things change, the more they stay the same! Schroder addresses issues with RPM (Red Hat Package Manager) basics and Yum (Yellow Dog Updater, Modified).

A natural transition to this chapter is "Installing and Managing Software on Debian-Based Systems" which introduces the package manager/dependency resolver, apt. A particularly nice addition here is a description of how to build a local Debian package repository for sharing out to client systems. This is a bit of how-to that is useful for sysadmins and is a welcome addition to a book of "solutions". Schroder follows this chapter with "Installing Programs from Source Code" which provides an alternative to using package management. Included here: generating a list of files from a source install, installing programs from source code and using CheckInstall to create packages.

Chapter 5, "Discovering Hardware from Outside the Box," illustrates the problem of detecting hardware. Schroder discusses an assortment of solutions: using Ispci, dmesg and reading /proc. Also included is how to view drive partitions and how to calculate drive capacity with fdisk.

Schroder chooses JOE and Vim as topics for her "Editing Text Files" chapter. This isn't intended to be a tutorial on each editor. Rather, the author provides some quick problem/solution scenarios that guide the reader through customizing the two editors to meet their unique preferences and she lists useful commands and offers recommendations on how to use vimtutor and Joe's online help to get up to speed.

Chapter 7 is titled "Starting and Stopping Linux" and begins by explaining runlevels then discusses how to start and stop X, how to change the default runlevel and how to manage Debian's and Red Hat's runlevels. Also included are command-line solutions to manually configure, start and stop services. The latter is particularly useful since many of us find ourselves needing to manually stop or restart a service when testing configuration changes. Another sysadmin tip found here is disabling or limiting access to Ctrl-Alt-Delete. This is a common "first step" to protecting a machine in an secure environment.

"Managing Users and Groups" is the topic of Chapter 8 and covers system accounts vs. human user accounts, finding UIDs and GIDs, modifying accounts (changing the login or UID, moving a home directory), deleting users and disabling accounts, killing user processes, password and disk quota management and using shell scripts to manage batches of users and passwords. Included in this chapter is the author's cautionary statements on using su and sudo to gain temporary root powers while doing system tasks at the command-line.

In the introduction to the next chapter, "Managing Files and Partitions," Schroder provides a well written primer on understanding filesystem fundamentals: Linux file types, file attributes and definitions, filesystem internals (logical block, logical volume, B+trees, etc.), and journaling filesystems. She uses this basis to tackle the common problem of controlling who has access to what file and uses the chmod (change mode) command to change file permissions. She includes batch operations and setting file and directory permissions with chmod. The next set of problems in this chapter deals with using the chown command to change ownership of files and directories and doing batch operations with chown. Other solutions here: setting up a shared directory with setgid and the sticky bit, using umask to set permissions defaults, configuring file system mounts with /etc/fstab, mounting and unmounting filesystems on hard drives (a common issue with dual or triple boot systems), using dmesg to find device names in order to mount them in conjunction with fdisk to show partition numbers on drives, creating and deleting files and directories using mkdir, touch and rm, using fdisk to create Linux disk partitions and creating a filesystem on a new partition. Pretty much everything one would desire to do bound in one chapter!

Chapter 10 is dedicated to "Patching, Customizing and Upgrading Kernels". Many users have avoided modifying their kernel because of fear of "hosing" the system entirely but Schroder shows that it's not that complicated and can be accomplished without fear of losing one's "old" kernel. She addresses upgrading to the latest stable version of the 2.4 kernel, adding new features to the 2.4 kernel, building the 2.6 kernel and removing a kernel patch (we've all needed to do this at one time or another).

The next chapter on CD and DVD recording will be a well thumbed section for many readers. Schroder points out that the "entire field is evolving rapidly, and CD/DVD standards are in a chaotic state." Schroder introduces some fundamental packages (cdrtools and dvd+rw-tools) and straightforward instructions on how to get the most out of CD/DVD. She begins with a fairly comprehensive Glossary of Formats and Standards which provides a good basis for getting a handle on a number of terms and changing technologies. Some problems she tackles here are common: finding the SCSI address for CD and DVD writers, enabling SCSI emulation for IDE/ATAPI CD and DVD writers, making a Linux and Windows readable data CD, copying a CD or DVD, erasing a CD-RW, recording a multisession data CD, creating a bootable CD using mkisofs (a pre-mastering program) and recording data DVD using growisofs (a front end to mkisofs).

"Managing the Bootloader and Multi-Booting" will also be a popular chapter, especially for LILO users who want to migrate to GRUB and newbies who will learn quite a bit about how bootloaders function and how Linux manages partitions. Many Linux users not only have a Windows partition on their system but other Linux distros happily sharing a drive. Schroder gives a nice step-by-step solution to correctly partitioning a drive for multi-booting various Windows OS versions and other Linux distros with bootloader solutions for both LILO and GRUB users.

We've all done it: hosed our system. Can't get past the errors, can't boot. Schroder turns to the best Linux recovery tool there is: Knoppix, a bootable, live CD with Linux drivers and utilities that automatically detect your existing partitions. This chapter covers all the necessary tools you'll need to get your system back up and your data recovered: booting Knoppix; creating a Knoppix boot diskette; saving your Knoppix config on a USB flash stick; creating a persistent, encrypted Knoppix home directory; copying files to another Linux PC; copying files to a Samba share (Windows PC); copying files to a CD-R/RW; installing software from Knoppix, repairing a lost root password; installing Knoppix to a hard disk and virus-scanning Windows PCs with Knoppix.

Chapter 14, "Printing with CUPS," describes the Common Unix Printing System and how to: find drivers; network printers; install printers on a standalone Linux PC; share a printer without using name resolution; share printers on a mixed LAN with Samba; build a dedicated CUPS printer server; restrict printers to select users and troubleshooting. There's more here than a typical home user will need to learn but it's well documented for a sysadmin.

Chapter 15 deals with "Configuring Video and Managing X Windows" and the author provides detail on the X Window System and, terminology, hardware (video adapters) and drivers. She leads the reader through installing new video adapters and making manual settings by editing XF86Config, configuring a multihead display, configuring startx to start the desktop or window manager and changing the login display manager.

Doing backups using rsync and incorporating Mondo Rescue for creating a bootable system restore disk is the topic of Chapter 16. Rsync is an extremely efficient and elegant solution to synchronized backup. Schroder covers local file transfers and synchronization, using ssh with rsync to authenticate login and encrypt the transport of data, building an rsync backup server, automating rsync over ssh backups, customizing filepaths in rsync and installing rsync on Windows clients. Also in this chapter are problems/solutions for creating a bootable system restore disc using Mondo Rescue. Mondo can also be used to clone Linux systems and for a complete system backup.

The next chapter, "Remote Access," concentrates on the SSH protocol: setting up OpenSSH, generating new host keys, authenticating via public keys, using multiple key pairs, using ssh-agent and keychain for passwordless logins. Schroder takes SSH a bit further with a section on tunneling X over SSH and solves the problem of accessing Linux boxes from Windows clients (using PuTTY and Cygwin).

For programmers or groups of users who are collaborating on a single project, version control is a powerful tool that can simplify and maintain both code and documentation trees. In chapter 18, Schroder shows the reader how to build a simple RCS (Revision Control System) repository then how to compare file versions in RCS; manage system config files with RCS, use CVS (Concurrent Versions System) for a single-user local repository; add and delete files from a CVS repository and how to create a shared CVS repository. She then goes into a good amount of detail working with files in CVS as well as building a public repository with Pserver and customizing the CVS environment.

Chapter 19 is dedicated to ntp (network time protocol) which will interest sysadmins. Schroder walks the reader through building a local time server using ntp and ntpdate, connecting the clients, adding access controls to ntp.conf and using iptables rules, setting up multiple local time servers and using ntp keys for authentication.

The next two chapters cover "Building a Postfix Mail Server" and the related "Managing Spam and Malware". Schroder chooses to pick one mail app for handling email, Postfix, rather than some of the other contenders (Sendmail, Exim or Qmail) and introduces the topic with a glossary of terms. She then helps the reader through a POP3 mail server setup, testing the mail server using telnet and openssl s_client, the basics of sending and receiving mail and installing Cyrus-SASL for SMTP authentication, among other topics. The author doesn't neglect IMAP servers or Squirrelmail and covers issues related to both. Schroder follows this with a comprehensive chapter on adding spam and virus-fighting tools to the Postfix server and includes a basic checklist for the admin who manages a cross-platform environment with Windows clients. She then discusses adding checks to /etc/postfix/ and provides a discussion on UBE (unsolicited bulk email) controls. The chapter continues with creating whitelists for management of wanted addresses, using DNS blackhole lists and setting up Clam Anti-Virus and SpamAssassin.

Schroder takes a simple approach to Apache installation and configuration in Chapter 22: a public web server for a single domain serving up static HTML pages. This is a very basic introduction to Apache and web serving on a Linux box. Her topics include how to start Apache at boot, password protecting individual directories, using robots.txt to control web crawlers, making custom error pages, using favicons and viewing Apache access logs with Webalizer. A bit thin on details in this chapter but adequate to get one up and running.

Sysadmins get another treat with Chapter 23: "File and Printer Sharing, and Domain Authentication with Samba." Schroder begins by building a simple Samba file server on a Windows LAN. She extends that a bit with a Windows/Linux peer-to-peer network then rounds that out with a description of how to add authentication to the Samba server in order to control access to the shares. For admins with a large numbers of users, Schroder helps solve the problem of converting /etc/passwd entries to smbpasswd format and copying them to /etc/samba/smbpasswd using the mksmbpasswd script. She also delves a bit deeper into controlling share access by using ACLs (access control lists). There are always groups of users who need to share files and those users who need a central network directory for their personal files and there are solutions here for creating public shares and home directories. The chapter then moves into building a PDC (primary domain controller) with Samba and connecting various Windows clients (95/98/ME/NT/2000 and XP) to a Samba domain as well as connecting Linux clients both by the command-line and with GUI LAN browsers like smb4k, LinNeighborhood, Konqueror and Nautilus. Password synchronization is briefly covered in one problem before the chapter switches gears to sharing Linux printers with Windows clients and vice versa. Running Windows applications directly on Linux is solved using CrossOver Office and Schroder applies the last section of this chapter to installation and discussion of this tool.

The last chapter of this book is dedicated to "Managing Name Resolution." Schroder offers a discussion of DNS and then provides a glossary of DNS terms before addressing the problems section. The author helps the reader enable name resolution on a LAN with hosts files then shows how to set up a DHCP server to take care of IP addresses. She then discusses configuration of Windows and Linux dhcp clients, adding static hosts to dhcp and running a public DNS server. Schroder looks at installing djbdns (initials of the creator, D. J. Bernstein + dns) as a secure, simple and robust alternative to BIND. Schroder shows how to configure the djbdns tools, tinydns and dnscache before giving a tour through BIND and how to set up a local BIND caching name server, installing both a private and a public BIND DNS server and building a BIND secondary server. The author finishes the book with a section on testing and querying DNS servers using dig and dnstrace.

The appendices offer extended information on how to find Linux documentation, a reference list of online hardware Web and Usenet sites, a list of Microsoft file types and extensions and an init script for CVSD.

O'Reilly is well known for producing high quality books that are beautifully bound and well designed. The layout of this book is simply presented with clear typography with chapter and topic headings easily discernible and command-line sections cleanly delineated. The book opens and stays open to selected pages for ease of use (no "cracking" of bindings allowed or necessary!); most of us like to follow along with a book splayed open next to our keyboard or laptop so it's nice not to have to balance our mug of coffee on one side of the book to prop it open.

The Linux Cookbook by Carla Schroder is extremely easy to navigate and very readable thanks to the author's sensible and practical topic selection, clarity of writing and humor. In providing solutions to common problems, Schroder has also managed to disperse valuable advice along the way. Her common sense approach to Linux systems management and administration shines through. The reader gets the benefit of the author's experience in this clearly written and valuable resource to Linux. A bonus is the author's enthusiasm for her topic. This translates into a pleasurable read. Much of this information is scattered across a large number of Websites but having a single competent resource to have at hand makes this book worth owning.

You can purchase the Linux Cookbook from Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Linux Cookbook

Comments Filter:

Behind every great computer sits a skinny little geek.