Tải bản đầy đủ (.pdf) (761 trang)

John wiley sons red hat linux bible fedora and enterprise edition lib

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (19.35 MB, 761 trang )

ABC Amber CHM Converter Trial version, />
Red Hat Linux Bible: Fedora and
Enterprise Edition
by Christopher Negus

ISB
N:0
764
543
334

John Wiley & Sons © 2003
Use this comprehensive guide to harness the
power of Red Hat Linux on a server, desktop,
or laptop computer. Coverage includes
desktop and server basics, simple, painless
installations, Linux Shell, using VmWare,
VNC, and more.

Table of Contents
Red Hat Linux Bible —Fedora and Enterprise Edition
Preface
Part I - Getting Started in Red Hat Linu x
Chapter 1

-

An Overview of Red Hat Linu x

Chapter 2


-

Installing Red Hat Linu x

Chapter 3

-

Getting Started with the Deskto p

Chapter 4

-

Using Linux Command s

Chapter 5

-

Accessing and Running Application s

Chapter 6

-

Publishing with Red Hat Linu x

Chapter 7


-

Playing Games with Red Hat Linu x

Chapter 8

-

Multimedia in Red Hat Linu x

Chapter 9

-

Tools for Using the Internet and the We b

Part II - Using Red Hat Linu x

Part III - Administering Red Hat Linu x
Chapter 10

-

Understanding System Administratio n

Chapter 11

-

Setting Up and Supporting User s


Chapter 12

-

Automating System Task s

Chapter 13

-

Backing Up and Restoring File s

Chapter 14

-

Computer Security Issue s

Part IV - Red Hat Linux Network and Server Setu p
Chapter 15

-

Setting Up a Local Area Networ k

Chapter 16

-


Connecting to the Interne t

Chapter 17

-

Setting Up a Print Serve r

Chapter 18

-

Setting Up a File Serve r

Chapter 19

-

Setting Up a Mail Serve r

Chapter 20

-

Setting Up an FTP Serve r

Chapter 21

-


Setting Up a Web Serve r

Chapter 22

-

Setting Up a News Serve r

Chapter 23

-

Setting Up Boot Servers: DHCP and NI S

Chapter 24

-

Setting Up a MySQL Database Serve r

Chapter 25

-

Making Servers Public with DN S

Chapter 26

-


Using Linux Servers from a Ma c

Appendix A

-

What's on the CD-ROM s

Appendix B

-

Red Hat Linux RPM s

Appendix C

-

Running Network Service s

Index
List of Figures


ABC Amber CHM Converter Trial version, />List of Tables
List of Sidebars


ABC Amber CHM Converter Trial version, />
Back Cover

If Red Hat Linux can do it, you can do it too…
With Red Hat Linux separating into the open source community Fedora Project and the commercial
Red Hat Enterprise Linux 3, new opportunities arise for Red Hat Linux users. Red Hat Linux Bible
leads you through the possibilities and choices between Fedora and enterprise installations.
Covering everything from detailed instructions to running desktop applications and setting up more
than a dozen server types, this book also features new sections on shell scripting, encryption
techniques, setting up RAID disks, using yum, and much more.
Inside, you ’ll find complete coverage of Red Hat Linux



Install, tune, and configure Fedora and Red Hat Linux Enterprise 3



Navigate GNOME and KDE desktops to run the latest applications



Learn to use the Linux shell, file system, and text editors



Try out the latest security techniques for detecting and dealing with attacks and setting up
encryption keys



Discover how to install extra software packages to play games, enhance security, and
administer Linux




Install Linux on a laptop and manage power events with acpid



Use the newest Linux multimedia tools for audio, video, and CD burning



Configure Samba file/printer sharing, iptables, firewalls, CUPS printers, and other features
using Red Hat as an AppleTalk or NFS server for Mac OS 9 or OS X computers



Manipulate file systems, tune disks, and support multiple users
About the Author

Christopher Negus has been working with UNIX systems, the Internet, and (more recently) Linux
systems for more than two decades. During that time, Chris worked at AT&T Bell Laboratories, UNIX
System Laboratories, and Novell, helping to develop the UNIX operating system. Features from
many of the UNIX projects Chris worked on at AT&T have found their way into Red Hat and other
Linux systems.
Most recently, Chris co-authored the book Linux Toys for Wiley Publishing. During the past few
years, Chris has written several books on UNIX and the Internet, including Caldera OpenLinux bible,
Internet Explorer 4 Bible, and Netscape Plug-Ins For Dummies for Wiley Publishing. He also wrote
several books for Que Corporation, including The Complete Idiot ’s Guide to Networking (second and
third editions) and Using UNIX (second edition). Chris ’s other writings include articles for Internet
World, NetWare Connection , and Visual Developer magazines.



ABC Amber CHM Converter Trial version, />

ABC Amber CHM Converter Trial version, />
Red Hat Linux Bible—Fedora and Enterprise Edition
Christopher Negus
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright 2004 by Wiley Publishing, Inc. All rights reserved.
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as
permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior
written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to
the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978)
750-4744. Requests to the Publisher for permission should be addressed to the Legal Department,
Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317)
572-4447, E-Mail:
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts
in preparing this book, they make no representations or warranties with respect to the accuracy or
completeness of the contents of this book and specifically disclaim any implied warranties of
merchantability or fitness for a particular purpose. No warranty may be created or extended by sales
representatives or written sales materials. The advice and strategies contained herein may not be
suitable for your situation. You should consult with a professional where appropriate. Neither the
publisher nor author shall be liable for any loss of profit or any other commercial damages, including but
not limited to special, incidental, consequential, or other damages.

For general information on our other products and services or to obtain technical support, 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.
Limited Warranty: (a)WPI warrants that the Software and Software Media are free from defects in
materials and workmanship under normal use for a period of sixty (60) days from the date of purchase of
this Book. If WPI receives notification within the warranty period of defects in materials or workmanship,
WPI will replace the defective Software Media. (b) WPI AND THE AUTHOR OF THE BOOK DISCLAIM
ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH
RESPECT TO THE SOFTWARE, THE PROGRAMS, THE SOURCE CODE CONTAINED THEREIN,
AND/OR THE TECHNIQUES DESCRIBED IN THIS BOOK. WPI DOES NOT WARRANT THAT THE
FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE
OPERATION OF THE SOFTWARE WILL BE ERROR FREE. (c) This limited warranty gives you
specific legal rights, and you may have other rights that vary from jurisdiction to jurisdiction.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print
may not be available in electronic books.
Wiley, the Wiley Publishing logo, and related trade dress are trademarks or registered trademarks of
John Wiley & Sons, Inc., and/or its affiliates in the United States and other countries and may not be
used without written permission. Red Hat and Fedora are trademarks of Red Hat, Inc. Linux is a
registered trademark of Linus Torvalds. All other trademarks are the property of their respective owners.
Wiley is not associated with any product or vendor mentioned in this book.
Library of Congress Control Number: 2003112325
ISBN: 0-7645-4333-4
10 9 8 7 6 5 4 3 2 1
1O/RR/RZ/QT/IN


ABC Amber CHM Converter Trial version, />About the Author
Christopher Negus has been working with UNIX systems, the Internet, and (more recently) Linux
systems for more than two decades. During that time, Chris worked at AT&T Bell Laboratories, UNIX

System Laboratories, and Novell, helping to develop the UNIX operating system. Features from many of
the UNIX projects Chris worked on at AT&T have found their way into Red Hat and other Linux systems.
Most recently, Chris co-authored the book Linux Toys for Wiley Publishing. During the past few years,
Chris has written several books on UNIX and the Internet, including Caldera OpenLinux Bible, Internet
Explorer 4 Bible, and Netscape Plug-Ins for Dummies for Wiley Publishing. He also co-wrote several
books for Que Corporation, including The Complete Idiot's Guide to Networking (second and third
editions) and Using UNIX (second edition). Chris's other writings include articles for Internet World,
NetWare Connection, and Visual Developer magazines.
At home, Chris enjoys spending time with his wife, Sheree, and his boys, Caleb and Seth. His hobbies
include soccer, singing, and exercising with Sheree.
Credits
Acquisitions Editor
Debra Williams Cauley
Development Editor
Sara Shlaer
Production Editor
Eric Newman
Technical Editor
Jason Luster
Copy Editor
C. M. Jones
Editorial Manager
Mary Beth Wakefield
Vice President and
Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Bob Ipsen
Vice President and Publisher
Joseph B. Wikert

Executive Editorial Director
Mary Bednarek
Project Coordinator
Bill Ramsey
Indexing
Johnna VanHoose Dinse
As always, I dedicate this book to my wife, Sheree. This book would never have happened without her
love and support.


ABC Amber CHM Converter Trial version, />
Preface
Many Linux books resemble someone's throwing a bunch of high-performance car parts on the floor and
saying, "Go ahead and build a Porsche." Although it's true that the parts you need for power computing
are in Linux, you still need to know how to put them together. Red Hat Linux Bible takes you through
those steps.

Who Are You?
You don't need to be a programmer to use this book. You may be someone who just wants to use Red
Hat Linux (to run programs, access the Internet, and so on). Or you may simply want to know how to
administer a Linux system in a workgroup or on a network.
I assume that you are somewhat computer-literate but have little or no experience with Linux (or UNIX).
You may be migrating from Microsoft operating systems to Red Hat Linux because of its networking
and multiuser features. You may be looking to start a career as a computer technician or network
administrator and find that spending a few dollars for an entire operating system and book is more
economical than taking those technical classes offered on late-night television. Or you might just think
a "free" operating system is cool.
In any case, after you peruse this book you should have a good idea how to run applications, set up a
small network, connect to the Internet, and configure a variety of server types (Web servers, print
servers, file servers, and so on). This book represents a great first couple of steps towards your

becoming someone who can set up a home network or a small office network and maintain a group of
computers.


ABC Amber CHM Converter Trial version, />
This Book's Learn-through-Tasks Approach
The best way to learn a computer system is to get your hands on it. To help you learn Red Hat Linux,
this book takes a task-oriented approach. Where possible, I step you through the process of working
with a feature, such as setting up a network or configuring your desktop.
When you are done with a task, you should have a good, basic setup of the feature that it covers. After
that, I often provide pointers to further information on tweaking and tuning the feature.
Instead of assuming that you already know about cryptic topics such as troff, NFS, and TCP/IP, I ease
you into those features with headings such as "Publishing with Red Hat Linux," "Setting up a File
Server," and "Connecting to the Internet." Heck, if you already knew what all those things were and how
to get them working, you wouldn't need me, would you?
When many tools can be used to achieve the same results, I usually present one or two examples. In
other words, I don't describe six different Web browsers, twelve different text editors, and three different
news servers. I tell you how to get one or two similar tools really working and then note the others that
are available.


ABC Amber CHM Converter Trial version, />
What You Need
To follow along with this book, you must install the software found on the accompanying CDs. To do
that, you need a PC with the following general configuration:
 An Intel Pentium or compatible CPU, 200Mhz or better (for text mode); 400Mhz or
better (for GUI mode). (Some Intel 486 computers may work, but it's hit-or-miss.)
 At least 64MB of RAM. To run the GNOME or KDE desktop 128MB are needed,
although Red Hat recommends 256MB.
 At least 510MB of hard disk space (you have to select a minimal install). You need

2.1GB of hard disk space for a personal desktop install, 2.6GB for a typical workstation
installation, or at least 920MB of space for a server installation. To install everything,
you need about 5.8GB of space.
 A CD-ROM drive. This is recommended for installation, although you can install over a
network or from a local hard disk instead. For those types of installs, you need at least
a 3.5-inch floppy disk drive and either an extra hard disk partition or another computer
(that can be reached over the network) that has packages or images of the Red Hat
Linux CDs on it. (I tell you how to do that later, in case you're interested.)
Not every piece of PC hardware works with Red Hat Linux. You can find a list of computer processors
that will work with Red Hat at www.redhat.com/hardware . You will probably want to use other
types of hardware (also on that list) with your Red Hat Linux system, including video cards, mice, sound
cards, modems, printers, scanners, joysticks, PCMCIA devices, and tape drives.
Cross-Referen
I describe hardware requirements in more detail during descriptions
ce
of Red Hat Linux installation in Chapter 2.


ABC Amber CHM Converter Trial version, />
Red Hat Linux Bible Improvements
Although this edition of Red Hat Linux Bible has Fedora and Enterprise Edition as the subtitle, you can
think of it as reflecting a step further in the progression of Red Hat Linux. Until the name of the Linux
distribution on the three CDs in this book was changed to Fedora Core, the distribution they reflected
was just the next Red Hat Linux (Red Hat Linux 7.3, 8, 9, ... Fedora).
That said, going forward Red Hat, Inc. has made a more definitive split between the Fedora Project and
Red Hat Linux Enterprise Product. For that reason, Chapter 1 is devoted to describing the differences
between Fedora Core and Red Hat Enterprise Linux.
Because most of the technologies in Fedora and Enterprise have not drifted so far, most of the
descriptions in this book will still work for both (with Enterprise including fewer of the bells, whistles, and
toys you get with Fedora and more features that scale up to large servers.)

As this book, too is meant to reflect a progression of Red Hat Linux, I have included a variety of
enhancements from the previous Red Hat Linux 9 Bible. Many of those enhancements are detailed
below:
 Installing Red Hat Linux — I adapted the installation procedure to match the Fedora
Core CDs that come with this book, and noted where the installation process differs for
Red Hat Enterprise Linux. I also noted that the LILO boot loader was removed from
Fedora, although it is still in Enterprise for the time being.
 Configuring RAID — I noted the ability to configure RAID disks during the installation
process (Chapter 2). In Chapter 10, I go into more detail about how, and why, you would
set up RAID disks in Red Hat Linux.
 GNOME 2.4 — Although there are important changes for developers in GNOME 2.4,
changes for end users are mostly reflected in a few new applications. In Chapter 9 I
describe Epiphany, which replaces Galeon as the default Web browser for GNOME.
 More text editors — For those who find the vi text editor challenging, in Chapter 4 I
noted several other text editors you can try.
 Using yum to get software — I added a description of the yum command and
yum.conf file to Chapter 5. Yum is a great tool for downloading and installing add-on
software packages in RPM format that are compiled specifically for each Red Hat Linux
distribution (with dependent packages downloaded and installed as well).
 Shift to ssh tools — Throughout this edition, I've tried to shift from old UNIX networking
tools ( ftp , rlogin , rsh , and the like) to more recent, more secure commands based
on the OpenBSD secure shell protocol ( ssh , sftp , and so on). Descriptions of rlogin
, rsh , and other "r" commands have moved to the Wiley companion Web site for this
book.
 Using WineX 3.1 Point2Play — In Chapter 7, I added a description of the new
Point2Play feature of WineX 3.1. Although not part of Red Hat Linux, this add-on can
help you get Windows games running in Linux.
 Cool Mozilla Web browsing tricks — Because we spend so much time browsing the
Web these days, I like to add extra tips on using Mozilla to each edition. For this
edition, I added some descriptions of tabbed browsing, the DOM inspector, and

keystrokes for resizing Web pages to Chapter 9. Mozilla also has a new Junk Mail
feature to help you build your own anti-spam rules in Mozilla Mail.
 Improving laptop performance — A new section in Chapter 10 describes how to
manage power better and generally improve laptop performance with Red Hat Linux.
 Using up2date for software updates — I added some information on how to configure
the new feature of up2date that lets you use apt and yum repositories to do software
updates of Red Hat Linux software in the Fedora Core.
 Removing temp files — I added a description to Chapter 11 about how tmpwatch
automatically cleans up temporary files in Red Hat Linux.
 Writing shell scripts — I pulled in my friend, and shell script expert, Kevin Pedigo to
completely overhaul the section on writing shell scripts in Chapter 12. Along with new
examples, Kevin added descriptions of how to use grep , cut , tr and sed in scripts.
 Improving security — For Chapter 14, I had security expert Chuck Wolber add new
sections on detecting and responding to denial-of-service, intrusion, and other attacks.
 Creating certificates — Another major enhancement Chuck made to Chapter 14 was


ABC Amber CHM Converter Trial version, />




a section on creating and obtaining SSL certificates to enable your Red Hat Linux
system to provide secure communications.
A few new options — As I go through the book, I try to add new descriptions of
options to old commands. A couple of note in this edition are the description of rpm -F
in Chapter 5 (a convenient option to update many packages at once without installing
new ones) and umount -l in Chapter 10 (to do lazy unmounts when resources are
busy).
Using Linux NFS file sharing from the MAC — I added a procedure for configuring

NFS in Linux (Chapter 26) so that a MAC OS X computer can use a shared NFS
directory from the Linux machine.

Besides these sections, procedures throughout the book have been tested and corrected to match
changes that have occurred to Red Hat Linux software in this version.


ABC Amber CHM Converter Trial version, />
Conventions Used in This Book
Throughout the book, special typefaces indicate code or commands. Commands and code are shown in
monospace type:
This is how code looks.
In the event that an example includes both input and output, monospace is still used, but input is
presented in bold type to distinguish the two. Here is an example:
$ ftp ftp.handsonhistory.com
Name (home:jake): jake
Password: ******
The following boxes are used to call your attention to points that are particularly important.
Note
A Note box provides extra information to which you need to pay special
attention.
Tip

A Tip box shows a special way of performing a particular task.

Caution

Cross-Referen
ce


A Caution box alerts you to take special care when executing a
procedure, or damage to your computer hardware or software could
result.
A Cross-Reference box refers you to further information on a subject
that you can find outside the current chapter.


ABC Amber CHM Converter Trial version, />
How This Book Is Organized
The book is organized into four parts.
Part I: Getting Started in Red Hat Linux
Part I consists of Chapters 1 and 2, which contain brief descriptions of the Linux technology and tell you
what you need in order to get the operating system installed. Chapter 1 serves as an introduction to the
Linux OS and to Red Hat Linux in particular. I also pay special attention to Red Hat, Inc.'s division
between the Fedora Project and Red Hat Enterprise Linux. Chapter 2 discusses what you need in order
to install Red Hat Linux (Fedora Core or Enterprise) and how to make the decisions you are faced with
during installation. It includes procedures for installing from CD-ROM, hard disk, or network connection
(NFS, FTP, or HTTP servers).
Part II: Using Red Hat Linux
Part II consists of Chapters 3 through 9, which include information for the average user who must use
Linux to run applications and access the Internet. In Chapter 3, you learn about the GNOME desktop
environment, the KDE desktop environment, and the X Window System. These GUIs provide graphical
means of using Red Hat Linux. Chapter 4 describes ways of exploring and understanding Red Hat
Linux, primarily from the Linux shell command interpreter. You learn how to use the bash shell, the vi
text editor, and the commands for moving around the Linux file system.
Chapter 5 contains information on obtaining, installing, and running Linux applications. It also helps you
run applications from other operating systems in Linux. Chapter 6 describes both old-time publishing
tools and new, graphical word processors that are available with Red Hat Linux. Old tools include the
troff and TeX text processing tools, whereas newer publishing software includes OpenOffice (included on
the CDs) and StarOffice (commercially available).

Graphical and character-based games that run in Red Hat Linux are described in Chapter 7. This
chapter also describes how to run commercial Windows games using WineX, and commercial Linux
games, such as "Civilization: Call to Power" and "Myth II," some of which have demo versions available.
Chapter 8 describes how to use audio and video players, as well as how to configure sound cards and
CD burners. Chapter 9 describes tools for browsing the Web (such as the Mozilla browser) and related
tools (such as e-mail clients and newsreaders).
Part III: Administering Red Hat Linux
Part III consists of Chapters 10 through 14, which cover general setup and system maintenance tasks,
including how to set up user accounts, automate system tasks, and back up your data. Chapter 10, in
which you learn what you need to know about basic system administration, describes the root login,
administrative commands, configuration files, and log files. Chapter 11 describes how to set up and
provide support for multiple users on your Red Hat Linux system.
In Chapter 12 you learn to create shell scripts and to use the cron facility to automate a variety of tasks
on your Red Hat Linux system. Techniques for backing up your system and restoring files from backup
are described in Chapter 13. Chapter 14 describes issues related to securing your computing assets in
Red Hat Linux.
Part IV: Red Hat Linux Network and Server Setup
Part IV consists of Chapters 15 through 26, which describe step-by-step procedures for setting up a
variety of server types. Simple configurations for what might otherwise be complex tasks are contained
in each chapter. Learn to arrange, address, and connect your Linux computers to a local area network
(LAN) in Chapter 15. Chapter 16 describes techniques for connecting your Linux computer and LAN to
the Internet, using features such as Point-to-Point Protocol (PPP), IP forwarding, IP masquerading,
routing, virtual private networks, and proxy servers.
Chapter 17 describes how to set up different types of print server interfaces, including Samba (to share
with Windows systems), NetWare, and native Linux printing. Chapter 18 describes file servers, such as
Network File System (NFS) servers, Samba file servers, and NetWare file servers. Chapter 19 describes
how to configure a sendmail e-mail server.
Chapter 20 describes how to configure and secure an FTP server, as well as how to access the server
using FTP client programs. Chapter 21 teaches you how to set up Red Hat Linux as a Web server,
focusing on the popular Apache server software. Chapter 22 describes how to set up an INN news

server, including determining how to set up news feeds, choosing news storage methods, and enabling
access to your INN server. Chapter 23 describes how to set up both DHCP and NIS services to
distribute information to client workstations on the network.


ABC Amber CHM Converter Trial version, />Chapter 24 describes how to set up and use a MySQL database server in Linux. Chapter 25 takes you
through the process of making the servers you configured in the other chapters available on the public
Internet. Setting up a Domain Name System (DNS) server is also described in Chapter 25. Chapter 26
describes how to set up Red Hat Linux to be a Macintosh file and printer server.
Appendixes
This book contains three appendixes. Appendix A describes the contents of the companion CD-ROMs,
Appendix B lists the hundreds of RPMs (software packages) that come with the Fedora Core
distribution of Red Hat Linux, and Appendix C provides an overview of setting up and running network
services.


ABC Amber CHM Converter Trial version, />
About the Companion CD-ROMs
The Fedora Core CD-ROMs that accompany this book provide the software you need for a complete,
working Red Hat Linux system. With this software, you can install sets of software packages that result
in personal desktop, workstation, or server configurations. This book describes how to configure and
use the software for those different configurations.


ABC Amber CHM Converter Trial version, />
About the Companion Web Site
Even in a book that pushes the 1000-page boundary, there are a few topics that don't seem to make the
cut. After you have gone through the book, you can visit the companion Web site at
www.wiley.com/compbooks/negus for some bonus material on topics such as using the X
Window system, finding neat add-on software, and exploring alternative administrative interfaces.

Software moved to the Web site from the previous edition of this book includes information on using
legacy UNIX remote commands ( rlogin , rcp , and the like), running Tripwire to manage system
security, and using crack and other password protection tools.


ABC Amber CHM Converter Trial version, />
Reach Out
If you have any questions or comments about this book, feel free to contact me by e-mail at this
address: .


ABC Amber CHM Converter Trial version, />
Acknowledgments
A special acknowledgment to the people at Red Hat, Inc., who, despite the massive shift in direction of
their Red Hat Linux product line, have managed to (once again) produce a rock-solid Linux distribution.
We're proud to include it with this book. Great job!
At Wiley, I'd like to thank Debra Williams Cauley, who has continued her heroic efforts to push the
latest editions of this book out to the world. Thanks to the tag team of Sara Shlaer and Eric Newman for
their editing and production work on this book and on Linux Toys (so that I could get back to this book).
Thanks to technical editor Jason Luster for plowing through the chapters yet again and to Margot Maley
Hutchison and the others at Waterside Productions for bringing me this project.
For this edition, I'd like to acknowledge excellent contributions from:
 Kevin Pedigo — For doing a great job rewriting the shell scripting section in Chapter 12.
 Chuck Wolber — For adding new sections to Chapter 14 on identifying different kinds of
security threats, as well as describing ways to combat those threats.
 François Caen — For using his skills as a Red Hat systems administrator to help me
sort through packaging differences in Fedora Core and Red Hat Enterprise Linux and
understand the new yum and revised up2date tools.
I'd also like to thank members of the Tacoma Linux User's Group for being a great resource for
discussions on Linux and (occasionally) non-Linux topics. On more than one occasion, the insights

from its members have helped me fix or rewrite parts of this book.
Thanks, as always, to my dear family for helping me through this project. Hopefully, I'll be able to join
Sheree, Caleb, and Seth on their next rock-climbing expedition.
Finally, a special thanks to those of you who bought this and earlier editions of Red Hat Linux Bible. Go
out and become a force for Linux in your work, home and community. And if you're looking for
something fun to do with Linux, check out Linux Toys, Wiley Publishing, Inc., by Christopher Negus and
Chuck Wolber.


ABC Amber CHM Converter Trial version, />
Part I:

Getting Started in Red Hat Linux

Chapter List
Chapter 1: An Overview of Red Hat Linux
Chapter 2: Installing Red Hat Linux


ABC Amber CHM Converter Trial version, />
Chapter 1: An Overview of Red Hat Linux
Overview
Linux was a phenomenon waiting to happen. The computer industry suffered from a rift. In the 1980s
and 1990s, people had to choose between inexpensive, market-driven PC operating systems from
Microsoft and expensive, technology-driven operating systems such as UNIX. Free software was being
created all over the world, but lacked a common platform to rally around. Linux has become that
common platform.
For several years, Red Hat Linux has been the most popular commercial distribution of Linux. With the
latest versions of Red Hat Linux (reflected in the Fedora Core and Red Hat Enterprise Linux
distributions), Red Hat, Inc. has taken steps to offer both free-flowing community versions and

well-supported commercial versions of Red Hat Linux.
Note
Because of significant overlap between Fedora Core and Red Hat
Enterprise Linux, I use the term Red Hat Linux to refer to technology in
both distributions. If software I describe is missing (primarily from
Enterprise, which doesn't include many games and personal software),
you can add the software later. Check your CDs, then check yum
repositories described in Chapter 5 to find software RPMs.


ABC Amber CHM Converter Trial version, />
Introducing Red Hat Linux
With the recent split between community (Fedora) and commercial (Red Hat Enterprise Linux) versions
of Red Hat Linux, Red Hat has created a model that can suit the fast-paced changes in the open source
world, while still meeting the demands for a well-supported commercial Linux distribution. (Later in this
chapter I discuss differences between the Fedora and Enterprise versions of Red Hat Linux.)
Technical people have chosen Red Hat Linux because of its reputation for solid performance. With the
new Fedora Project, Red Hat hopes to create an environment where open source developers can bring
high-quality software packages to Red Hat Linux that would be beyond the resources of Red Hat, Inc. to
test and maintain on its own.
Over 1,400 individual software packages (compared to just over 600 in Red Hat Linux 6.2) are included
in the latest release of Red Hat Linux, referred to as Fedora Core. These packages contain features that
would cost you hundreds or thousands of dollars to duplicate if you bought them as separate
commercial products. These features let you:
 Connect your computers to a LAN or the Internet.
 Create documents and publish your work on paper or on the Web.
 Work with multimedia content to manipulate images, play music files, view video, and
even burn your own CDs.
 Play games individually or over a network.
 Communicate over the Internet using a variety of Web tools for browsing, chatting,

transferring files, participating in newsgroups, and sending and receiving e-mail.
 Protect your computing resources by having Red Hat Linux act as a firewall and/or a
router to protect against intruders coming in through public networks.
 Configure a computer to act as a network server, such as a print server, Web server, file
server, mail server, news server, and a database server.
This is just a partial list of what you can do with Red Hat Linux. Using this book as your guide, you will
find that there are many more features built into Red Hat Linux as well.
Support for new video cards, printers, storage devices, and applications are being added every day.
Linux programmers around the world are no longer the only ones creating hardware drivers. Every day
more hardware vendors are creating their own drivers, so they can sell products to the growing Linux
market. New applications are being created to cover everything from personal productivity tools to
programs that access massive corporate databases.
Remember that old Pentium computer in your closet? Don't throw it away! Just because a new release
of Red Hat Linux is out doesn't mean that you need all new hardware for it to run. Support for many old
computer components get carried from one release to the next. There are old PCs running Red Hat
Linux today as routers (to route data between your LAN and the Internet), firewalls (to protect your
network from outside intrusion), and file servers (to store shared files on your LAN) — with maybe an
Ethernet card or an extra hard disk added.
At this point, you may feel that Linux is something you want to try out. This brings us to the basic
question: What is Linux?


ABC Amber CHM Converter Trial version, />

ABC Amber CHM Converter Trial version, />
What Is Linux?
Linux is a free operating system that was created by Linus Torvalds when he was a student at the
University of Helsinki in 1991. Torvalds started Linux by writing a kernel — the heart of the operating
system — partly from scratch and partly by using publicly available software. (For the definition of an
operating system and a kernel, see the sidebar "What Is an Operating System?" later in this chapter.)

Torvalds then released the system to his friends and to a community of "hackers" on the Internet and
asked them to work with it, fix it, and enhance it. It took off.
Cross-Referen
See Chapter 14 for a discussion about the difference between
ce
hackers (who just like to play with computers) and crackers (who
break into computer systems and cause damage).
Today, there are hundreds of software developers around the world contributing software to the Linux
effort. Because the source code for the software is freely available, anyone can work on it, change it, or
enhance it. Developers are encouraged to feed their fixes and improvements back into the community
so that Linux can continue to grow and improve.
On top of the Linux kernel effort, the creators of Linux also drew on a great deal of system software and
applications that are now bundled with Linux from the GNU software effort (GNU stands for "GNU is Not
UNIX"), which is directed by the Free Software Foundation ( www.gnu.org ). There is a vast amount of
software that can be used with Linux, all of which includes features that can compete with or surpass
those of any other operating system in the world.
If you have heard Linux described as a free version of UNIX, there is good reason for it. Although much
of the code for Linux started from scratch, the blueprint for what the code would do was created to follow
POSIX standards. POSIX (Portable Operating System Interface for UNIX) is a computer industry
operating system standard that every major version of UNIX complied with. In other words, if your
operating system was POSIX-compliant, it was UNIX. See the next section describing Linux's roots in
the UNIX operating system.


ABC Amber CHM Converter Trial version, />
Linux's Roots in UNIX
Linux grew within a culture of free exchange of ideas and software. Like UNIX — the operating system
on which Linux is based — the focus was on keeping communications open among software
developers. Getting the code to work was the goal, without much concern about who owned the code,
and the Internet was the primary communications medium. What, then, were the conditions that made

the world ripe for a computer system such as Linux?

What Is an Operating System?
An operating system is made up of software instructions that lie between the computer hardware
(disks, memory, ports, and so on) and the application programs (word processors, Web browsers,
spreadsheets, and so on). At the center is the kernel, which provides the most basic computing
functions (managing system memory, sharing the processor, opening and closing devices, and so
on). Besides the kernel, an operating system provides other basic services needed to operate the
computer, including:








File systems — The file system provides the structure in which information is stored
on the computer. Information is stored in files, primarily on hard disks inside the
computer. Files are organized within a hierarchy of directories. The Linux file system
holds the data files that you save, the programs you run, and the configuration files
that set up the system.
Device drivers — These provide the interfaces to each of the hardware devices
connected to your computer. A device driver enables a program to write to a device
without needing to know details about how each piece of hardware is implemented.
The program opens a device, sends and receives data, and closes a device.
User interfaces — An operating system needs to provide a way for users to run
programs and access the file system. Linux has both graphical and text-based user
interfaces. GNOME and KDE provide graphical user interfaces, whereas shell
command interpreters (such as bash ) run programs by typing commands and

options.
System services — An operating system provides system services, many of which
can be started automatically when the computer boots. In Linux, system services
can include processes that mount file systems, start your network, and run
scheduled tasks. In Linux, many services run continuously, enabling users to access
printers, Web pages, files, databases, and other computing assets over a network.

Without an operating system, an application program would have to know the details of each piece of
hardware, instead of just being able to say, "open that device and write a file there."

In the 1980s and 1990s, while Microsoft flooded the world with personal computers running DOS and
Windows operating systems, power users demanded more from an operating system. They ached for
systems that could run on networks, support many users at once (multiuser), and run many programs
at once (multitasking). DOS (Disk Operating System) and Windows didn't cut it.
UNIX, on the other hand, grew out of a culture where technology was king and marketing people were,
well, hard to find. Bell Laboratories in Murray Hill, New Jersey, was a think tank where ideas came first
and profits were somebody else's problem. A quote from Dennis Ritchie, co-creator of UNIX and
designer of the C programming language, in a 1980 lecture on the evolution of UNIX, sums up the spirit
that started UNIX. He was commenting on both his hopes and those of his colleagues for the UNIX
project after a similar project called Multics had just failed:
What we wanted to preserve was not just a good environment in which to do programming, but a system


ABC Amber CHM Converter Trial version, />around which a fellowship could form. We knew from experience that the essence of communal
computing as supplied by remote-access, time-shared machines, is not just to type programs into a
terminal instead of a keypunch, but to encourage close communication.
In that spirit, the first source code of UNIX was distributed free to universities. Like Linux, the availability
of UNIX source code made it possible for a diverse population of software developers to make their own
enhancements to UNIX and share them with others.
By the early 1980s, UNIX development moved from the organization in Murray Hill to a more

commercially oriented development laboratory in Summit, New Jersey (a few miles down the road).
During that time, UNIX began to find commercial success as the computing system of choice for
applications such as AT&T's telephone switching equipment, for supercomputer applications such as
modeling weather patterns, and for controlling NASA space projects.
Major computer hardware vendors licensed the UNIX source code to run on their computers. To try to
create an environment of fairness and community to its OEMs (original equipment manufacturers),
AT&T began standardizing what these different ports of UNIX had to be able to do to still be called UNIX.
To that end, compliance with POSIX standards and the AT&T UNIX System V Interface Definition (SVID)
were specifications UNIX vendors could use to create compliant UNIX systems. Those same documents
also served as road maps for the creation of Linux.
Today, Linux continues to aim toward POSIX compliance, as well as compliance with standards set by
the new owner of the UNIX trademark, The Open Group ( ).


×