Preface


The book


Whether you are an end user, a system administrator, or a little of each, this book explains with step-by-step examples how to get the most out of a Fedora Core or Red Hat Enterprise Linux system. In 28 chapters, this book takes you from installing a Fedora Core or Red Hat Enterprise Linux system through understanding its inner workings to setting up secure servers that run on the system.

The audience


This book is designed for a wide range of readers. It does not require you to have programming experience, but having some experience using a general-purpose computer is helpful. This book is appropriate for

  • Students who are taking a class in which they use Linux

  • Home users who want to set up and/or run Linux

  • Professionals who use Linux at work

  • System administrators who need an understanding of Linux and the tools that are available to them

  • Computer science students who are studying the Linux operating system

  • Programmers who need to understand the Linux programming environment

  • Technical executives who want to get a grounding in Linux

Benefits


A Practical Guide to Red Hat® Linux®: Fedora Core™ and Red Hat Enterprise Linux, Third Edition, gives you a broad understanding of many facets of Linux, from installing Red Hat Linux through using and customizing it. No matter what your background, this book gives you the knowledge you need to get on with your work. You will come away from this book understanding how to use Linux, and this book will remain a valuable reference for years to come.

Overlap


If you read A Practical Guide to Linux® Commands, Editors, and Shell Programming, you will notice some overlap between that book and the one you are reading now. The first chapter, and the chapters on the utilities, the filesystem, programming tools, and the appendix on regular expressions are very similar in the two books, as are the three chapters on the Bourne Again Shell (bash). Chapters that appear in this book but not in A Practical Guide to Linux® Commands, Editors, and Shell Programming include Chapters 2 and 3 (installation), Chapters 4 and 8 (Red Hat Linux and the GUI), Chapter 10 (networking), all of the chapters in Part IV (system administration) and Part V (servers), and Appendix C (security).

This Book Includes Fedora Core 5 on a DVD

A Practical Guide to Red Hat® Linux®, Third Edition, includes a DVD that you can use to install or upgrade to Fedora Core 5. Chapter 2 helps you get ready to install Fedora Core. Chapter 3 provides step-by-step instructions for installing Fedora Core from this DVD. This book guides you through learning about, using, and administrating Fedora Core or Red Hat Enterprise Linux.

What Is New in This Edition?

The third edition of A Practical Guide to Red Hat® Linux® covers Fedora Core 5 and Red Hat Enterprise Linux version 4. All the changes, large and small, that have been made to these products since the second edition of this book have been incorporated into the explanations and examples. The following list details the sections of this book that have undergone the most major changes.

  • Access Control Lists (ACLs; page 185) A security feature that provides finer-grained control over which users can access specific directories and files than do traditional Linux permissions.

  • SELinux (Security Enhanced Linux; page 400) A security feature that enforces security policies that limit what a user or program can do.

  • bash (the Bourne Again Shell; Chapters 7, 9, and 28) These chapters have been reorganized and rewritten to provide clearer explanations and better examples of how bash works both from the command line in day-to-day work and as a programming language to write shell scripts.

  • yum (page 476) A program that keeps Fedora Core systems up-to-date. The yum utility downloads software from repositories on the Internet. It can upgrade existing software and install new software. You can run yum manually or have it run automatically every night.

  • pirut (page 483) A graphical software package management utility. The pirut utility is similar to yum except that it works with groups of software packages. For example, you can use pirut to download and install the entire KDE desktop environment with one command.

  • parted (page 65) A command line utility that reports on and manipulates hard disk partitions.

Features of This Book

This book is designed and organized so you can get the most out of it in the shortest amount of time. You do not have to read this book straight through in page order. Once you are comfortable using Linux, you can use this book as a reference: Look up a topic of interest in the table of contents or index and read about it. Or think of the book as a catalog of Linux topics: Flip through the pages until a topic catches your eye. The book includes many pointers to Web sites where you can get additional information: Consider the Internet an extension of this book.

A Practical Guide to Red Hat® Linux®, Third Edition, is structured with the following features:

  • In this book, the term Red Hat Linux refers to both Fedora Core and Red Hat Enterprise Linux. Features that apply to only one operating system or the other are marked as such using these indicators: FEDORA or RHEL.

  • Optional sections enable you to read the book at different levels, returning to more difficult material when you are ready to delve into it.

  • Caution boxes highlight procedures that can easily go wrong, giving you guidance before you run into trouble.

  • Tip boxes highlight ways that you can save time by doing something differently or situations when it may be useful or just interesting to have additional information.

  • Security boxes point out places where you can make a system more secure. The security appendix presents a quick background in system security issues.

  • Concepts are illustrated by practical examples throughout the book.

  • Chapter summaries review the important points covered in each chapter.

  • Review exercises are included at the end of each chapter for readers who want to further hone their skills. Answers to even-numbered exercises are at www.sobell.com.

  • This book provides resources for finding software on the Internet. It also explains how download and install software using yum, BitTorrent, and, for Red Hat Enterprise Linux, Red Hat Network (RHN).

  • The glossary defines more than 500 common terms.

  • The book describes in detail many important GNU tools, including the gcc C compiler, the gdb debugger, the GNU Configure and Build System, make, and gzip.

  • Pointers throughout the text provide help in obtaining online documentation from many sources including the local system, the Red Hat Web site, and other locations on the Internet.

  • Many useful URLs (Internet addresses) point to sites where you can obtain software, security programs and information, and more.

  • The comprehensive index helps you locate topics quickly and easily.

Key Topics Covered in This Book

This book contains a lot of information. This section distills and summarizes its contents. You may want to review the table of contents for more detail. This book

Installation


  • Describes how to download from the Internet and burn a Fedora Core installation DVD or CDs.

  • Helps you plan the layout of the system's hard disk and assists you in using Disk Druid or parted to partition the hard disk.

  • Explains how to use the Logical Volume Manager (LVM2) to set up, grow, and migrate logical volumes, which are similar in function to traditional disk partitions.

  • Describes in detail how to install Red Hat Linux from a DVD, CDs, a hard disk, or over a network using FTP, NFS, or HTTP.

  • Covers responses to the boot: prompt and explains how to work with Anaconda, Red Hat's installation program.

  • Covers the details of installing and customizing the X.org version of the X Window System.

    Working with Red Hat Linux


  • Introduces the graphical desktop (GUI) and explains how to use desktop tools including the panel, Panel menu, Main menu, Window Operations menu, Desktop menu, Desktop switcher, and terminal emulator.

  • Presents the KDE desktop and covers using Konqueror to manage files, start programs, and browse the Web.

  • Covers the GNOME desktop and the Nautilus file manager.

  • Explains how to customize your desktop to please your senses and help you work more efficiently.

  • Covers the Bourne Again Shell (bash) in three chapters, including an entire chapter on shell programming that includes many sample shell scripts.

  • Explains the command line interface and introduces more than 30 command line utilities.

  • Presents a tutorial on the vim (vi work-alike) textual editor.

  • Covers types of networks, network protocols, and network utilities.

  • Explains hostnames, IP addresses, and subnets, and explores how to use host and dig to look up domain names and IP addresses on the Internet.

  • Covers distributed computing and the client/server model.

    System administration


  • Explains how to use the Red Hat system-config-* tools to configure the display, DNS, Apache, a network interface, and more. You can also use these tools to add users and manage local and remote printers. (See page 415 for a list of the tools.)

  • Describes how to use the following tools to download software and keep a system current:

    • yum Downloads and installs software packages from the Internet, keeping a system up-to-date and resolving dependencies as it processes the packages. You can run yum manually or set it up to run automatically every night.

    • BitTorrent Good for distributing large amounts of data such as the Fedora installation DVD and CDs. The more people who use BitTorrent to download a file, the faster it works.

    • up2date The Red Hat Enterprise Linux tool for keeping system software current.

  • Covers graphical system administration tools, including the Main menu, GNOME and KDE menu systems, KDE Control Center, and KDE Control panel.

  • Explains system operation, including the boot process, init scripts, emergency mode, rescue mode, single-user and multiuser modes, and steps to take if the system crashes.

  • Describes files, directories, and filesystems, including types of files and filesystems, fstab (the filesystem table), automatically mounted filesystems, filesystem integrity checks, filesystem utilities, and fine-tuning of filesystems.

  • Covers backup utilities including tar, cpio, dump, and restore.

  • Explains how to customize and build a Linux kernel.

    Security


  • Helps you manage basic system security issues using ssh (secure shell), vsftpd (secure FTP server), Apache (the httpd Web server), iptables (firewall), and more.

  • Presents a complete section on SELinux (Security Enhanced Linux), including instructions for using system-config-securitylevel to configure SELinux.

  • Covers using system-config-securitylevel to set up a basic firewall to protect the system.

  • Provides instructions on using iptables to share an Internet connection over a LAN and to build advanced firewalls.

  • Describes how to set up a chroot jail to protect a server system.

  • Explains how to use TCP wrappers to control who can access a server.

  • Covers controlling servers using the xinetd superserver.

    Clients and servers


  • Explains how to set up and use the most popular Linux servers, providing a chapter on each: Apache, Samba, OpenSSH, sendmail, DNS, NFS, FTP, iptables, and NIS (all of which are included with Red Hat Linux).

  • Describes how to set up a CUPS printer server.

  • Describes how to set up and use a DHCP server.

    Programming


  • Covers programming tools including the GNU gcc compiler, the gdb debugger, make, and CVS for managing source code.

  • Explains how to debug a C program.

  • Describes how to work with shared libraries.

  • Provides a complete chapter on shell programming using bash, including many examples.

Details

Part I


Part I, "Installing Red Hat Linux," discusses how to install Fedora Core or Red Hat Enterprise Linux. Chapter 2 presents an overview of the process of installing Red Hat Linux, including hardware requirements, downloading and burning a DVD or CDs, and planning the layout of the hard disk. Chapter 3 is a step-by-step guide to installing either version of Red Hat Linux and covers installing from a DVD or CDs, from a local hard disk, and over the network using FTP, NFS, or HTTP. It also shows how to set up the X Window System and customize your graphical user interface (GUI).

Part II


Part II, "Getting Started with Red Hat Linux," familiarizes you with Red Hat Linux, covering logging in, the GUI, utilities, the filesystem, and the shell. Chapter 4 introduces desktop features, including the panel and the Main menu; explains how to use Konqueror to manage files, run programs, and browse the Web; and covers finding documentation, dealing with login problems, and using the window manager. Chapter 5 introduces the shell command line interface, describes more than 30 useful utilities, and presents a tutorial on the vim text editor. Chapter 6 discusses the Linux hierarchical filesystem, covering files, filenames, pathnames, working with directories, access permissions, and hard and symbolic links. Chapter 7 introduces the Bourne Again Shell (bash) and discusses command line arguments and options, redirecting input to and output from commands, running programs in the background, and using the shell to generate and expand filenames.

Tip: Experienced users may want to skim Part II

If you have used a UNIX or Linux system before, you may want to skim over or skip some or all of the chapters in Part II. All readers should take a look at "Conventions Used in This Book" (page 17), which explains the typographic and layout conventions that this book uses, and "Getting the Facts: Where to Find Documentation" (page 102), which points out both local and remote sources of Linux and Red Hat documentation.


Part III


Part III, "Digging into Red Hat Linux," goes into more detail about working with the system. Chapter 8 discusses the GUI and includes a section on how to run a graphical program on a remote system and have the display appear locally. The section on GNOME describes GNOME utilities and explains how to use the Nautilus file manager, including its spatial view, while the section on KDE explains more about Konqueror and KDE utilities. Chapter 9 extends the bash coverage from Chapter 7, explaining how to redirect error output, avoid overwriting files, and work with job control, processes, startup files, important shell builtin commands, parameters, shell variables, and aliases. Chapter 10 explains networks, network security, and the Internet and discusses types of networks, subnets, protocols, addresses, hostnames, and various network utilities. The section on distributed computing describes the client/server model and some of the servers you can use on a network. Details of setting up and using clients and servers are reserved until Part V.

Part IV


Part IV covers system administration. Chapter 11 discusses core concepts such as Superuser, SELinux (Security Enhanced Linux), system operation, general information about how to set up a server, DHCP, and PAM. Chapter 12 explains the Linux filesystem, going into detail about types of files, including special and device files, the use of fsck to verify the integrity of and repair filesystems, and the use of tune2fs to change filesystem parameters. Chapter 13 explains how to keep a system up-to-date by downloading software from the Internet and installing it, including examples of using yum, BitTorrent, and Red Hat's up2date utility. Chapter 14 explains how to set up the CUPS printing system so you can print on the local system as well as on remote systems. Chapter 15 details customizing and building a Linux kernel. Chapter 16 covers additional administration tasks, including setting up user accounts, backing up files, scheduling automated tasks, tracking disk usage, and solving general problems. Chapter 17 explains how to set up a local area network (LAN), including both hardware (including wireless) and software setup.

Part V


Part V goes into detail about setting up and running servers and connecting to them with clients. The chapters in this part of the book cover the following clients/servers:

  • OpenSSH Set up an OpenSSH server and use sh, scp, and sftp to communicate securely over the Internet.

  • FTP Set up a vsftpd secure FTP server and use any of several FTP clients to exchange files with the server.

  • Mail Configure sendmail and use Webmail, POP3, or IMAP to retrieve email; use SpamAssassin to combat spam.

  • NIS Set up NIS to facilitate system administration of a LAN.

  • NFS Share filesystems between systems on a network.

  • Samba Share filesystems and printers between Windows and Linux systems.

  • DNS/BIND Set up a domain nameserver to let other systems on the Internet know the names and IP addresses of your systems they may need to contact.

  • iptables Share a single Internet connection between systems on a LAN and set up a firewall to protect local systems.

  • Apache Set up an HTTP server that serves Web pages that browsers can display.

Part VI


Part VI covers programming. Chapter 27 discusses programming tools and environments available under Red Hat Linux, including the C programming language and debugger, make, shared libraries, and source code management using CVS. Chapter 28 goes into greater depth about shell programming using bash, with the discussion being enhanced by extensive examples.

Part VII


Part VII includes appendixes on regular expressions, helpful Web sites, system security, and free software. This part also includes an extensive glossary with more than 500 entries and a comprehensive index.

Supplements

The author's home page (www.sobell.com) contains downloadable listings of the longer programs from this book as well as pointers to many interesting and useful Linux sites on the World Wide Web, a list of corrections to the book, answers to even-numbered exercises, and a solicitation for corrections, comments, and suggestions.

Thanks

First and foremost I want to thank Mark L. Taub, editor-in-chief, Prentice Hall, who encouraged and prodded me (carrot-and-stick approach) and kept me on track. Mark is unique in my 25 years of book writing experience: an editor who works with the tools I am writing about. Because Mark runs Linux on his home computer, we share experiences as I write. His comments and direction are invaluable. Thank you, Mark T.

Thanks also to the folks at Prentice Hall who helped bring this book to life, especially Julie Nahil, full-service production manager, who gave me guidance and much latitude while keeping me to schedule in producing the book; John Fuller, managing editor, who kept the large view in check; Noreen Regina, editorial assistant, who attended to the many details involved in publishing this book; Heather Fox, publicist; Dan Scherf, media developer; Sandra Schroeder, design manager; Kim Spilker, marketing manager; and everyone else who worked behind the scenes to make this book happen.

I am also indebted to Denis Howe, the editor of The Free On-line Dictionary of Computing (FOLDOC). Denis has graciously permitted me to use entries from his compilation. Be sure to look at the dictionary (www.foldoc.org).

A big "thank you" to the folks who read through the drafts of the book and made comments that caused me to refocus parts of the book where things were not clear or were left out altogether: David Chisnall; Chris Karr, Northwestern University; Jesse Keating, Fedora Project; Scott Mann, IBM, Systems Management and Integration Professional; Matthew Miller, Boston University; and George Vish, Senior Education Consultant, HP US Linux Program Manager, Hewlett-Packard Company.

Thanks also to the following people who helped with the first and second editions of this book: Carsten Pfeiffer, Software Engineer and KDE Developer; Aaron Weber, Ximian; Cristof Falk, Software Developer at CritterDesign; Steve Elgersma, Computer Science Department, Princeton University; Scott Dier, University of Minnesota; Robert Haskins, Computer Net Works; Lars Kellogg-Stedman, Harvard University; Jim A. Lola, Principal Systems Consultant, Privateer Systems, LLC; Eric S. Raymond, cofounder, Open Source Initiative; Scott Mann; Randall Lechlitner, Independent Computer Consultant; Jason Wertz, Computer Science Instructor, Montgomery County Community College; Justin Howell, Solano Community College; Ed Sawicki, The Accelerated Learning Center; David Mercer, Contechst; Jeffrey Bianchine, Advocate, Author, Journalist; John Kennedy; and Jim Dennis, Starshine Technical Services.

Thanks also to Dustin Puryear, Puryear Information Technology; Gabor Liptak, Independent Consultant; Bart Schaefer, Chief Technical Officer, iPost; Michael J. Jordan, Web Developer, Linux Online Inc.; Steven Gibson, owner of SuperAnt.com; John Viega, founder and Chief Scientist, Secure Software, Inc.; K. Rachael Treu, Internet Security Analyst, Global Crossing; Kara Pritchard, K & S Pritchard Enterprises, Inc.; Glen Wiley, Capital One Finances; Karel Baloun, Senior Software Engineer, Looksmart, Ltd.; Matthew Whitworth; Dameon D. Welch-Abernathy, Nokia Systems; Josh Simon, Consultant; Stan Isaacs; and Dr. Eric H. Herrin II, Vice President, Herrin Software Development, Inc. And thanks to Doug Hughes, long-time system designer and administrator, who gave me a big hand with the sections on system administration, networks, the Internet, and programming.

More thanks go to consultants Lorraine Callahan and Steve Wampler; Ronald Hiller, Graburn Technology, Inc.; Charles A. Plater, Wayne State University; Bob Palowoda; Tom Bialaski, Sun Microsystems; Roger Hartmuller, TIS Labs at Network Associates; Kaowen Liu; Andy Spitzer; Rik Schneider; Jesse St. Laurent; Steve Bellenot; Ray W. Hiltbrand; Jennifer Witham; Gert-Jan Hagenaars; and Casper Dik.

A Practical Guide to Red Hat® Linux®, Third Edition, is based in part on two of my previous UNIX books: UNIX System V: A Practical Guide and A Practical Guide to the UNIX System. Many people helped me with those books, and thanks here go to Pat Parseghian, Dr. Kathleen Hemenway, and Brian LaRose; Byron A. Jeff, Clark Atlanta University; Charles Stross; Jeff Gitlin, Lucent Technologies; Kurt Hockenbury; Maury Bach, Intel Israel Ltd.; Peter H. Salus; Rahul Dave, University of Pennsylvania; Sean Walton, Intelligent Algorithmic Solutions; Tim Segall, Computer Sciences Corporation; Behrouz Forouzan, DeAnza College; Mike Keenan, Virginia Polytechnic Institute and State University; Mike Johnson, Oregon State University; Jandelyn Plane, University of Maryland; Arnold Robbins and Sathis Menon, Georgia Institute of Technology; Cliff Shaffer, Virginia Polytechnic Institute and State University; and Steven Stepanek, California State University, Northridge, for reviewing the book.

I continue to be grateful to the many people who helped with the early editions of my UNIX books. Special thanks are due to Roger Sippl, Laura King, and Roy Harrington for introducing me to the UNIX system. My mother, Dr. Helen Sobell, provided invaluable comments on the original manuscript at several junctures. Also, thanks go to Isaac Rabinovitch, Professor Raphael Finkel, Professor Randolph Bentson, Bob Greenberg, Professor Udo Pooch, Judy Ross, Dr. Robert Veroff, Dr. Mike Denny, Joe DiMartino, Dr. John Mashey, Diane Schulz, Robert Jung, Charles Whitaker, Don Cragun, Brian Dougherty, Dr. Robert Fish, Guy Harris, Ping Liao, Gary Lindgren, Dr. Jarrett Rosenberg, Dr. Peter Smith, Bill Weber, Mike Bianchi, Scooter Morris, Clarke Echols, Oliver Grillmeyer, Dr. David Korn, Dr. Scott Weikart, and Dr. Richard Curtis.

I take responsibility for any errors and omissions in this book. If you find one or just have a comment, let me know (mgs@sobell.com) and I will fix it in the next printing. My home page (www.sobell.com) contains a list of errors and credits those who found them. It also offers copies of the longer scripts from the book and pointers to many interesting Linux pages.


Mark G. Sobell
San Francisco, California




A Practical Guide to Red Hat Linux
A Practical Guide to Red HatВ® LinuxВ®: Fedoraв„ў Core and Red Hat Enterprise Linux (3rd Edition)
ISBN: 0132280272
EAN: 2147483647
Year: 2006
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net