®
PRESS
®
®
®
PRESS
Red Hat Linux Networking
and System Administration
Linux Solutions from the Experts at Red Hat
SECURITY TOOLS
INCLUDED ON CD-ROM
Collings
& Wall
Your Official Red Hat
®
Linux
®
Guide to Networking and System Administration
K
URT
W
ALL
has worked with Linux and Unix for nine years and is the
author of several other books, including Red Hat Linux 7.2 Weekend
Crash Course and Linux Programming by Example.
T
ERRY
C
OLLINGS
basics—network planning and Red Hat installation and configuration.
They then show you in detail how to set up network and Internet services,
from establishing a network file system to configuring mail services. Eight
chapters give you the lowdown on customizing the kernel, automating
tasks with scripting, performing backups, and more—the nuts-and-bolts
maintenance information you need to keep your system running smoothly.
And last but not least, the authors provide nearly 100 pages of proven
strategies and tips for maintaining system security.
Complete with utilities and code on CD-ROM, this official Red Hat
Linux guide is the one resource you need for a secure, high-performance
Linux network.
9 780764 536328
55999
ISBN 0-7645-3632-X
7
85555 09538
0
Proven Red Hat Linux Networking and Administration Solutions
CD-ROM INCLUDES
Code, scripts, and ex-
amples from the book
Linux networking and
administration tools,
including Ethereal,
logcheck, NET-SNMP,
Nmap, Portsentry,
Tripwire and SAINT
trial version
Plus a searchable
e-version of the book
M
S
E
C
U
R
I
T
Y
T
O
O
L
S
I
N
C
L
U
D
E
D
™
Red Hat
®
Linux
®
Networking
and System Administration
a3632-X FM.F 2/21/02 8:33 AM Page i
Published by
Hungry Minds, Inc.
909 Third Avenue
New York, NY 10022
www.hungryminds.com
Copyright © 2002 Hungry Minds, Inc. All rights reserved. No part of this book, including interior design, cover design,
and icons, may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording, or
otherwise) without the prior written permission of the publisher.
Library of Congress Control Number: 2001093591
ISBN: 0-7645-3632-X
Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
1O/RT/QT/QS/IN
Distributed in the United States by Hungry Minds, Inc.
Distributed by CDG Books Canada Inc. for Canada; by Transworld Publishers Limited in the United Kingdom; by IDG
Norge Books for Norway; by IDG Sweden Books for Sweden; by IDG Books Australia Publishing Corporation Pty. Ltd.
for Australia and New Zealand; by TransQuest Publishers Pte Ltd. for Singapore, Malaysia, Thailand, Indonesia, and
Hong Kong; by Gotop Information Inc. for Taiwan; by ICG Muse, Inc. for Japan; by Intersoft for South Africa; by
Eyrolles for France; by International Thomson Publishing for Germany, Austria, and Switzerland; by Distribuidora
Cuspide for Argentina; by LR International for Brazil; by Galileo Libros for Chile; by Ediciones ZETA S.C.R. Ltda. for
Peru; by WS Computer Publishing Corporation, Inc., for the Philippines; by Contemporanea de Ediciones for
Venezuela; by Express Computer Distributors for the Caribbean and West Indies; by Micronesia Media Distributor, Inc.
for Micronesia; by Chips Computadoras S.A. de C.V. for Mexico; by Editorial Norma de Panama S.A. for Panama; by
American Bookshops for Finland.
For general information on Hungry Minds’ products and services please contact our Customer Care department within
the U.S. at 800-762-2974, outside the U.S. at 317-572-3993 or fax 317-572-4002.
For sales inquiries and reseller information, including discounts, premium and bulk quantity sales, and foreign-
language translations, please contact our Customer Care department at 800-434-3422, fax 317-572-4002 or write to
Hungry Minds, Inc., Attn: Customer Care Department, 10475 Crosspoint Boulevard, Indianapolis, IN 46256.
For information on licensing foreign or domestic rights, please contact our Sub-Rights Customer Care department at
job is at Muhlenberg College in Allentown, PA, where he is the school’s
Instructional Technologist. His main function in this position is assisting faculty in
the use of computer technology to augment their classroom presentations. He is
also the system administrator for the school’s online course content management
software. Terry also teaches a wide range of computer and technology-related
courses in the evenings at Allentown Business School. Terry has been a technical
editor for several Hungry Minds, Inc., books and is the co-author of the Linux Bible.
He can be reached at
.
Kurt Wall first touched a computer in 1980 when he learned FORTRAN on an
IBM mainframe of forgotten vintage; things have only gotten better since then.
These days, Kurt is a full-time Linux and Unix author, editor, consultant, and
programmer. He has written five books about Linux and Unix programming and
system administration, is working on his sixth, and is the technical editor for over
a dozen other Linux- and Unix-related titles. Currently, Kurt works from his home
in Indianapolis. He can be reached via e-mail at
.
a3632-X FM.F 2/21/02 8:33 AM Page v
Credits
CONTRIBUTING WRITERS
Viktorie Navratilova
Dennis Powell
Brandon Wiley
ACQUISITIONS EDITOR
Terri Varveris
PROJECT EDITOR
Martin V. Minner
TECHNICAL EDITORS
Hulton Getty
PROOFREADING AND INDEXING
TECHBOOKS Production Services
a3632-X FM.F 2/21/02 8:33 AM Page vi
This book is dedicated to the victims and heroes of September 11, 2001.
a3632-X FM.F 2/21/02 8:33 AM Page vii
a3632-X FM.F 2/21/02 8:33 AM Page viii
Preface
Red Hat Linux is the most popular distribution of Linux currently in use. Red Hat
Linux has shown itself to be a robust, reliable operating system that can run on a
variety of hardware, from personal computers to large mainframes. Linux in general,
and Red Hat Linux in particular, is a very powerful operating system that can be used
at the enterprise level as a full-fledged server, as well as at the workstation level for
typical user applications. For those of us dissatisfied with the reliability of other com-
mercially available operating systems, Red Hat Linux is a pleasant alternative.
How This Book Is Organized
This book is divided into five parts. Each part covers a specific area of functionality
in a typical Red Hat Linux system.
Part I — Red Hat Linux System and Network
Administration Defined
This part describes the duties of a system administrator. Chapter 1 explains some of
the more common tasks, such as installing servers and application software,
managing user accounts, and backing up and restoring files. Many more topics are
covered in this chapter. Chapter 2 details the steps involved in planning and build-
ing a network and planning for security and disaster recovery. Chapter 3 takes you
through the steps required to install Red Hat Linux on a local system as well as on
a remote system. Chapter 4 gives an explanation of the Red Hat Linux file system
and storage devices. Chapter 5, the last chapter in Part I, lists the system and
network configuration files and their uses.
Part II — Red Hat Linux Network Services
discusses upgrading and customizing the kernel for your specific needs. Chapter 18
tells you how to use the command line to perform all of your system administrative
tasks. If you want to use scripts to automate some of your work, Chapter 19 is where
you find out how to do it. Chapter 20 deals with monitoring the performance of your
system. Creating users and groups is a basic part of system maintenance, and
Chapter 21 describes this process. Chapter 22 details the steps necessary to back up
your file system and use the backups to restore your system. The final chapter in this
part, Chapter 23, gives instructions on installing and upgrading software packages.
Part V — Security and Problem Solving
A critical area of concern for system administrators is maintaining a secure system.
Most of the chapters in this part deal with security, beginning with Chapter 24,
which covers security basics. Chapter 25 addresses local, or host-based, security. In
Chapter 26 you find an explanation of firewalls and Internet security and the risks
you may encounter from outside connections. Chapter 27 looks at ways to monitor
a Red Hat Linux system for attempted, potential, and actual security compromises
using the tools available in a standard Red Hat Linux installation. The last chapter
in this part, Chapter 28, lists problems you may encounter during normal operation
of your system and the steps to take to solve the problems discussed.
x Preface
a3632-X FM.F 2/21/02 8:33 AM Page x
How to Use This Book
Our intention for this book is to cover the Red Hat Linux operating system in
enough detail to provide the answers that you need. The book is divided into the
parts previously discussed to make it easy for you to go to the specific part for the
topic you need to learn about. You can use the book as a reference for whatever
you need to know about a particular topic.
Using this book’s icons
Watch for the following margin icons to help you get the most out of this book:
Tips provide special information or advice.
Caution icons warn you of a potential problem or error.