You are previewing A Practical Guide to Red Hat Linux: Fedora Core and Red Hat Enterprise Linux, Second Edition.
O'Reilly logo
A Practical Guide to Red Hat Linux: Fedora Core and Red Hat Enterprise Linux, Second Edition

Book Description

The best just became BETTER! Completely revised to meet all your Red Hat Linux needs!

Fedora Core and Red Hat Enterprise Linux are advanced operating systems. You need a book that's just as advanced. This book explains Linux clearly and effectively--with a focus on the features you care about, including system security, Internet server setup, and sharing files and printers with Windows systems. Best-selling Linux author Mark Sobell starts at the beginning and walks you through everything that matters, from installing Fedora Core using the included CDs to GNOME, KDE, Samba 3, sendmail, Apache, DNS, NIS, and iptables. Along the way, you learn the "hows" and the "whys." Whether you are a user, an administrator, or a programmer, this book gives you all you need and more. Mark Sobell knows every Linux nook and cranny, has taught hundreds of thousands of readers, and never forgets what it's like to be new to Linux.

Don't settle for yesterday's Linux book...get the ONLY book that meets today's challenges and tomorrow's!

Compared with the other Linux books out there, A Practical Guide to Red Hat® Linux®, Second Edition, delivers...

  • The full Fedora Core operating system on 4 CDs (not the truncated "Publisher's Edition") AND complete coverage of Fedora Core and the 2.6 Linux kernel, PLUS coverage of Red Hat Enterprise Linux

  • Deeper coverage of GNOME and KDE, including customization

  • More practical coverage of file sharing with Samba, NFS, and FTP

  • Easier-to-follow coverage of Internet server configuration including Apache, sendmail, NFS, and DNS

  • More up-to-date coverage of security, including SELinux (Security Enhanced Linux), OpenSSH, and firewall setup using iptables

  • Better coverage of "meat-and-potatoes" system/network administration tasks

  • A more practical introduction to writing bash shell scripts

  • More complete coverage of configuring local and network printers using CUPS

  • And much more...including a 500+ word glossary and a comprehensive index to help you find what you need fast!

  • Includes 4 CDs!
    Get the full version of Red Hat's Fedora Core 2 release!

    Table of Contents

    1. Copyright
      1. Dedication
    2. Preface
      1. This Book Includes the Full Fedora Core 2 on Four CDs
      2. Features of This Book
      3. Key Topics This Book Covers
        1. Details
      4. Supplements
      5. Thanks
    3. 1. Welcome to Linux
      1. The GNU-Linux Connection
        1. Fade to 1983
        2. Next Scene, 1991
        3. The Code Is Free
        4. Have Fun!
      2. The Linux 2.6 Kernel
      3. The Heritage of Linux: UNIX
      4. What Is So Good About Linux?
        1. Why Linux Is Popular with Hardware Companies and Developers
        2. Linux Is Portable
        3. Standards
        4. The C Programming Language
      5. Overview of Linux
        1. Linux Has a Kernel Programming Interface
        2. Linux Can Support Many Users
        3. Linux Can Run Many Tasks
        4. Linux Provides a Secure Hierarchical Filesystem
        5. The Shell: Command Interpreter and Programming Language
          1. Filename Generation
          2. Device-Independent Input and Output
          3. Shell Functions
          4. Job Control
        6. A Large Collection of Useful Utilities
        7. Interprocess Communication
        8. System Administration
      6. Additional Features of Linux
        1. GUI: Graphical User Interfaces
        2. (Inter)networking Utilities
        3. Software Development
      7. Conventions Used in This Book
        1. Red Hat Linux
        2. Examples
        3. Items You Enter
        4. Utility Names
        5. Filenames
        6. Characters and Character Strings
        7. Buttons and Labels
        8. Keys and Characters
        9. Prompts and RETURNs
        10. Menu Selection Path
        11. Definitions
        12. URLs (Web Addresses)
        13. Tip, Caution, and Security Boxes
      8. Chapter Summary
      9. Exercises
    4. I. Installing Red Hat Linux
      1. 2. Installation Overview
        1. More Information
        2. Planning the Installation
          1. Considerations
          2. Installation Requirements
          3. What Are You Installing: Fedora Core or Red Hat Enterprise Linux?
          4. Installing a Fresh Copy or Upgrading an Existing Red Hat System?
          5. Types of Installations (FEDORA)
          6. Graphical or Textual Installation?
          7. Setting Up the Hard Disk
            1. Primary and Extended Partitions
            2. Partitioning a Disk
              1. Planning Partitions
              2. Partition Suggestions
          8. Raid
          9. LVM (Logical Volume Manager)
        3. How the Installation Works
        4. The Medium: Where Is the Source Data?
          1. Formats
          2. Sources
            1. CD
            2. Hard Disk
            3. Network
        5. Downloading, Burning, and Installing a CD Set (FEDORA)
          1. Finding a Site to Download From
          2. Finding the Right Files and Downloading Them
          3. Using BitTorrent to Download the ISO Image Files
          4. Checking the Files
          5. Burning the CDs
        6. Rescue CD
        7. Collecting Information About the System
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
      2. 3. Step-by-Step Installation
        1. Installing Red Hat Linux
          1. Booting the System: The boot: Prompt
          2. Boot Commands
          3. The Anaconda Installer
            1. Using Anaconda
            2. Anaconda Screens
          4. When You Reboot
          5. Initializing Databases
        2. Installation Tasks
          1. Using Disk Druid to Partition the Disk
          2. Using the Kickstart Configurator
          3. fdisk: Reports On and Partitions a Hard Disk
          4. Setting Up a Dual-Boot System
            1. Creating Free Space on a Windows System
            2. Installing Red Hat Linux as the Second Operating System
        3. The X Window System
          1. system-config-display: Configuring the Display
          2. The xorg.conf and XF86Config Files
            1. ServerLayout
            2. InputDevice
            3. Monitor
            4. Device
            5. Screen
            6. Multiple Monitors
          3. gdm: Displays a Graphical Login
            1. Configuring gdm
            2. Using kdm
          4. More Information
        4. Chapter Summary
        5. Exercises
        6. Advanced Exercises
    5. II. Getting Started with Red Hat Linux
      1. 4. Introduction to Red Hat Linux
        1. Curbing Your Power: Superuser/root/Administrator Access
        2. A Tour of the Red Hat Linux Desktop
          1. Logging In on the System
          2. Getting the Most from the Desktop
            1. The Power of the Desktop: Using the Main Panel
            2. Launching Applications from the Main Menu
            3. Controlling Windows I
              1. Changing the Input Focus (Window Cycling)
              2. Shading a Window
              3. Cutting and Pasting Objects Using the Clipboard
            4. Controlling the Desktop Using the Root Window
            5. Running Commands from the Terminal Emulator/Shell
          3. Using Konqueror to Manage Files, Run Programs, and Browse the Web
          4. Customizing Your Desktop with the Control Center
          5. Customizing the Main Panel Using the Panel Menu
        3. Getting the Facts: Where to Find Documentation
          1. The KDE Help Center
          2. man: Displaying the System Manual
          3. info: Displaying Information About Utilities
          4. HOWTOs: Finding Out How Things Work
          5. Getting Help with Your System
            1. Finding Help Locally
            2. Using the Internet to Get Help
        4. More About Logging In
          1. The Login Screen
          2. What to Do If You Cannot Log In
          3. Logging Out
          4. Using Virtual Consoles
          5. Logging In Remotely: Terminal Emulation and telnet
          6. Changing Your Password
          7. switchdesk: Changing Your Default Desktop
          8. Logging In from a Terminal
            1. Bringing a GUI Up from a Character-Based Display
            2. Correcting Mistakes
              1. Erasing a Character
              2. Deleting a Word
              3. Deleting a Line
              4. Aborting Execution
            3. Repeating/Editing Command Lines
        5. Controlling Windows II
          1. Changing the Input Focus
          2. Changing the Resolution of the Display
          3. Understanding the Window Manager
            1. Red Hat Window Managers
          4. Session Management
        6. Chapter Summary
        7. Exercises
        8. Advanced Exercises
      2. 5. The Linux Utilities
        1. Special Characters
        2. Basic Utilities
          1. ls: Lists the Names of Files
          2. cat: Displays a Text File
          3. rm: Deletes a File
          4. less Is more: Displaying a Text File One Screen at a Time
          5. hostname: Displays Your Machine Name
        3. Working with Files
          1. cp: Copies a File
          2. mv: Changes the Name of a File
          3. lpr: Prints a File
          4. grep: Finds a String
          5. head: Displays the Beginning of a File
          6. tail: Displays the End of a File
          7. sort: Displays a File in Order
          8. uniq: Removes Duplicate Lines from a File
          9. diff: Compares Two Files
          10. file: Tests the Contents of a File
        4. | (Pipe): Communicates Between Processes
        5. Four More Utilities
          1. echo: Displays Text
          2. date: Displays the Time and Date
          3. script: Records a Linux Session
          4. mcopy: Converts Linux Files to Windows Format
        6. Compressing and Archiving a File
          1. gzip: Compresses a File
          2. gunzip and zcat: Decompress a File
          3. bzip2: Compresses/Decompresses a File
          4. tar: Packs and Unpacks Files
        7. Locating Commands
          1. which, whereis: Locate a Utility
          2. apropos: Searches for a Keyword
        8. Obtaining User and System Information
          1. who: Lists Users on the System
          2. finger: Lists Users on the System
          3. w: Lists Users on the System
        9. Communicating with Other Users
          1. write: Sends a Message
          2. talk: Communicates with Another User
          3. mesg: Denies or Accepts Messages
        10. Email
        11. Tutorial: Creating and Editing a File with vim (vi)
          1. Specifying a Terminal
          2. Starting vim
          3. Command and Input Modes
          4. Entering Text
          5. Getting Help
            1. Correcting Text as You Insert It
            2. Moving the Cursor
            3. Deleting Text
            4. Undoing Mistakes
            5. Inserting Additional Text
            6. Correcting Text
          6. Ending the Editing Session
        12. Chapter Summary
        13. Exercises
        14. Advanced Exercises
      3. 6. The Linux Filesystem
        1. The Hierarchical Filesystem
        2. Directory and Ordinary Files
          1. Filenames
            1. Filename Extensions
            2. Invisible Filenames
          2. mkdir: Creates a Directory
          3. The Working Directory
            1. Significance of the Working Directory
          4. Home Directory
            1. cd: Changes to Another Working Directory
            2. Startup Files
          5. Absolute Pathnames
          6. Relative Pathnames
            1. The . and .. Directory Entries
          7. Important Standard Directories and Files
        3. Working with Directories
          1. rmdir: Deletes a Directory
          2. Pathnames
          3. mv, cp: Moves or Copies a File
          4. mv: Moves a Directory
        4. Access Permissions
          1. ls –l: Displays Permissions
          2. chmod: Changes Access Permissions
          3. Setuid and Setgid Permissions
          4. Directory Access Permissions
          5. Links
          6. Symbolic Link
            1. In: Creates a Symbolic Link
          7. rm: Removes a Link
        5. Chapter Summary
        6. Exercises
        7. Advanced Exercises
      4. 7. The Shell I
        1. The Command Line
          1. Syntax
            1. Command Name
            2. Arguments
              1. Options
          2. Processing the Command Line
          3. Executing the Command Line
        2. Standard Input and Standard Output
          1. The Screen as a File
          2. The Screen/Keyboard as Standard Input and Standard Output
        3. Redirection
          1. Redirecting Standard Output
          2. Redirecting Standard Input
          3. Appending Standard Output to a File
          4. /dev/null: Data Sink
        4. Pipes
          1. Filters
          2. tee: Sends Output in Two Directions
        5. Running a Program in the Background
        6. Filename Generation/Pathname Expansion
          1. The ? Special Character
          2. The * Special Character
          3. The [ ] Special Characters
        7. Builtins
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
    6. III. Digging Into Red Hat Linux
      1. 8. Linux GUIs: X, GNOME, and KDE
        1. X Window System
          1. Using X
            1. Starting X from a Character-Based Display
            2. Remote Computing and Local Displays
            3. Stopping the X Server
            4. Remapping Mouse Buttons
          2. Window Managers
            1. KDE and GNOME
            2. GNUStep
            3. TWM
        2. Using GNOME
          1. Using the Nautilus File Manager
            1. Spatial View
            2. Traditional View
              1. Side Pane
              2. View Pane
              3. Control Bars
            3. Features Available from Both Spatial and Traditional Views
            4. Properties
            5. Start Here
          2. GNOME Utilities
            1. Search Tool
            2. Simple Search
              1. Advanced Search
            3. Font Preferences
            4. Pick a Font Window
            5. Pick a Color Window
            6. Run Application Window
            7. File Types and Programs (MIME Types)
            8. GNOME Terminal Emulator/Shell
        3. Using KDE
          1. Konqueror Browser/File Manager
            1. Web Shortcuts
            2. Bookmarks
            3. Menubar
            4. Toolbars
              1. Main Toolbar
              2. Extra Window Toolbar
              3. Location Bar
              4. Bookmark Toolbar
            5. kfind: Finds Files
            6. Views II
              1. Active View Indicator
              2. Link Indicator
              3. Lock to Current Location/Unlock View
            7. Shortcuts
            8. Navigation Panel
          2. KDE Utilities
            1. konsole: Terminal Emulator
            2. kcolorchooser: Selects a Color
            3. Run Command
              1. klipper: Clipboard Utility
        4. Chapter Summary
        5. Exercises
        6. Advanced Exercises
      2. 9. The Shell II: The Bourne Again Shell
        1. Background
        2. Shell Basics
          1. Assignment Statements
          2. Writing a Simple Shell Script
            1. chmod: Makes a File Executable
        3. Separating and Grouping Commands
          1. ; and NEWLINE Separate Commands
          2. \ Continues a Command
          3. | and & Separate Commands and Do Something Else
        4. Redirecting Standard Error
        5. noclobber: Avoids Overwriting Files
        6. Job Control
          1. jobs: Lists Jobs
          2. fg: Brings a Job to the Foreground
          3. bg: Sends a Job to the Background
        7. Manipulating the Directory Stack
          1. dirs: Displays the Stack
          2. pushd: Pushes a Directory on the Stack
          3. popd: Pops a Directory Off the Stack
        8. Processes
          1. Process Structure
          2. Process Identification
          3. Executing a Command
          4. Running a Shell Script
            1. #! Specifies a Shell
            2. # Begins a Comment
            3. Startup Files
        9. Parameters and Variables
          1. User-Created Variables
            1. unset: Removes a Variable
            2. readonly: Makes a Variable Permanent
            3. export: Makes a Variable Global
            4. declare: Sets Attributes and Values for a Shell Variable
            5. read: Accepts User Input
            6. $(...) or ’...’ Command Substitution
          2. Keyword Variables
            1. HOME: Your Home Directory
            2. PATH: Where the Shell Looks for Programs
            3. MAIL: Where Your Mail is Kept
            4. PS1: User Prompt (Primary)
            5. PS2: User Prompt (Secondary)
            6. IFS: Separates Input Fields
            7. CDPATH: Broadens the Scope of cd
            8. Running a Startup File with the . (dot) or source Builtin
          3. Positional Parameters
            1. $0: Name of the Calling Program
            2. $1–$n: Command Line Arguments
            3. shift: Promotes Command Line Arguments
            4. set: Initializes Command Line Arguments
          4. Special Parameters
            1. $* and $@ Value of Command Line Arguments
            2. $# Number of Command Line Arguments
            3. $$ PID Number
            4. $? Exit Status
        10. History
        11. Editing the Command Line
          1. fc: Displays, Edits, and Reexecutes Commands
            1. Viewing the History List
            2. Editing and Reexecuting Previous Commands
            3. Reexecuting Commands Without Calling the Editor
          2. Reexecuting an Event with the C Shell History Mechanism
            1. !! Reexecutes the Previous Event
            2. !n Event Number
            3. !string Event Text
          3. The Readline Library
            1. Basic Readline Commands
            2. Completion
            3. Miscellaneous Commands
            4. .inputrc
        12. Alias
          1. Quotation Marks: Single versus Double
          2. Examples
        13. Command Line Expansion
          1. Order of Expansion
          2. { } Brace Expansion
          3. ~ Tilde Expansion
          4. $n Parameter Expansion
          5. $VARIABLE Variable Expansion
          6. $(...) Command Substitution
          7. Arithmetic Expansion
          8. Word Splitting
          9. Pathname Expansion
        14. Chapter Summary
        15. Exercises
        16. Advanced Exercises
      3. 10. Networking and the Internet
        1. Types of Networks and How They Work
          1. Broadcast
          2. Point-to-Point
          3. Switched
          4. LAN: Local Area Network
            1. Ethernet
            2. Wireless
          5. WAN: Wide Area Network
          6. Internetworking Through Gateways and Routers
            1. Firewall
          7. Network Protocols
            1. IP: Internet Protocol
            2. TCP: Transmission Control Protocol
            3. UDP: User Datagram Protocol
            4. PPP: Point-to-Point Protocol
            5. Xremote and LBX
          8. Host Address
            1. Static versus Dynamic IP Addresses
          9. Hostnames
            1. IPv6
            2. IPv6
        2. Communicate over a Network
          1. finger: Displays Information About Remote Users
          2. Sending Mail to a Remote User
          3. Mailing List Servers
        3. Network Utilities
          1. Trusted Hosts
          2. OpenSSH Tools
          3. telnet: Logs in on a Remote System
          4. ftp: Transfers Files over a Network
          5. ping: Tests a Network Connection
          6. traceroute: Traces a Route over the Internet
          7. host and dig: Queries Internet Nameservers
          8. whois: Looks Up Information About an Internet Site
        4. Distributed Computing
          1. The Client/Server Model
          2. DNS: Domain Name Service
          3. NIS: Network Information Service
          4. NFS: Network Filesystem
        5. Usenet
        6. WWW: World Wide Web
          1. URL: Uniform Resource Locator
          2. Browsers
          3. Search Engine
        7. Chapter Summary
        8. Exercises
        9. Advanced Exercises
    7. IV. System Administration
      1. 11. System Administration: Core Concepts
        1. System Administrator and Superuser
          1. System Administration Tools
            1. su: Gives You Another User’s Privileges
            2. consolehelper: Runs Programs as Root
            3. kill: Sends a Signal to a Process
        2. Rescue Mode
          1. Avoiding a Trojan Horse
          2. Getting Help
        3. SELinux (FEDORA)
        4. System Operation
          1. Booting the System
          2. Init Scripts: Start and Stop System Services
            1. service: Configures Services I
            2. system-config-services: Configures Services II
            3. chkconfig: Configures Services III
          3. Emergency Mode
          4. Single-User Mode
          5. Going Multiuser
          6. Multiuser/Graphics Mode
          7. Logging In
          8. Running a Program and Logging Out
          9. Bringing the System Down
            1. CONTROL-ALT-DEL: Reboots the System
            2. consolehelper: Allows an Ordinary User to Run a Privileged Command
            3. Going Single-user
            4. Turning the Power Off
          10. Crash
            1. Repairing a Filesystem
            2. When the System Does Not Boot
        5. Useful Utilities
          1. Red Hat Configuration Tools
          2. Linux Utilities
        6. Setting Up a Server
          1. Standard Rules in Configuration Files
            1. Specifying Clients
            2. Specifying a Subnet
          2. rpcinfo: Displays Information About portmap
          3. The xinetd Super Server
          4. Securing a Server
            1. TCP Wrappers: Client/Server Security (hosts.allow and hosts.deny)
            2. Setting Up a chroot Jail
              1. Using chroot
              2. Running a Service in a chroot Jail
              3. Security Considerations
          5. DHCP
            1. More Information
            2. How DHCP Works
            3. DHCP Client
              1. Prerequisites
              2. dhclient: The DHCP Client
            4. DHCP Server
              1. Prerequisites
              2. dhcpd: The DHCP Daemon
              3. Static IP Addresses
        7. nsswitch.conf: Which Service to Look at First
          1. How nsswitch.conf Works
            1. Information
            2. Methods
            3. Search Order
            4. Action Items
            5. compat Method: ± in passwd, group, and shadow files
        8. PAM
          1. More Information
          2. Configuration File, Module Type, and Control Flag
          3. Example
          4. Modifying the PAM Configuration
        9. Chapter Summary
        10. Exercises
        11. Advanced Exercises
      2. 12. Files, Directories, and Filesystems
        1. Important Files and Directories
        2. File Types
          1. Ordinary Files, Directories, Links, and Inodes
          2. Special Files
            1. FIFO Special File (Named Pipe)
            2. Sockets
            3. Major and Minor Device Numbers
            4. Block and Character Devices
            5. Raw Devices
        3. Filesystems
          1. mount: Mounts a Filesystem
            1. Mount Options
            2. Mounting a Linux Floppy Diskette
          2. umount: Unmounts a Filesystem
          3. fstab: Keeps Track of Filesystems
          4. fsck: Checks Filesystem Integrity
          5. tune2fs: Changes Filesystem Parameters
          6. RAID Filesystem
        4. Chapter Summary
        5. Exercises
        6. Advanced Exercises
      3. 13. Downloading and Installing Software
        1. system-config-packages: Adds and Removes Software Packages
        2. rpm: Red Hat Package Manager
          1. Querying Packages and Files
          2. Installing, Upgrading, and Removing Packages
          3. Installing a Linux Kernel Binary
        3. Installing Non-rpm Software
          1. The /opt and /usr/local Directories
          2. GNU Configure and Build System
        4. Keeping Software Up-to-Date
          1. Bugs
          2. Errata
          3. Fedora, Red Hat Enterprise Linux, Red Hat Network, and up2date
            1. up2date: Updates Packages
            2. up2date-config: Configures up2date
            3. Red Hat Network Alert Notification Tool
          4. Red Hat Network (RHEL)
            1. Subscribing to Red Hat Network (RHEL)
            2. rhnsd: RHN Daemon
        5. Keeping the System Up-to-Date
          1. yum: Updates and Installs Packages
            1. Configuring yum
            2. Using yum
          2. Apt: An Alternative to yum
            1. Using Apt on Your System
              1. Installing and Setting Up Apt
              2. Adding and Removing Individual Packages
              3. apt.conf: Configuring Apt
            2. synaptic: The Apt GUI
            3. Creating a Repository
          3. BitTorrent
            1. Prerequisites
            2. How BitTorrent Works
            3. Using BitTorrent
          4. wget: Download Files Noninteractively
        6. Chapter Summary
        7. Exercises
        8. Advanced Exercises
      4. 14. Printing with CUPS
        1. Introduction
          1. Prerequisites
          2. More Information
        2. JumpStart I: Configuring a Local Printer Using system-config-printer
        3. JumpStart II: Configuring a Remote Printer Using CUPS
        4. Traditional UNIX Printing
        5. Configuring Printers Using CUPS
          1. The CUPS Web Interface
            1. Setting Up and Modifying a Printer
            2. Jobs
            3. Classes
          2. CUPS on the Command Line
            1. lpinfo: Display Available Drivers
            2. lpadmin: Configure Printers
              1. Adding or Modifying a Printer
              2. Example lpadmin commands
            3. Printing Quotas
            4. Managing Print Queues
          3. Sharing CUPS Printers
        6. The GNOME Print Manager
        7. The KDE Printing Manager
        8. Integration with Windows
          1. Printing from Windows
          2. Printing to Windows
        9. Chapter Summary
        10. Exercises
        11. Advanced Exercises
      5. 15. Rebuilding the Linux Kernel
        1. Preparing the Source Code
          1. Locating the Source Code
          2. Installing the Source Code
        2. Read the Documentation
        3. Configuring and Compiling the Linux Kernel
          1. Cleaning the Source Tree
          2. Configuring the Linux Kernel
            1. EXTRAVERSION Number
          3. Compiling the Linux Kernel
          4. Using Loadable Kernel Modules
        4. Installing the Kernel and Associated Files
          1. Changing lilo.conf (RHEL)
          2. grub.conf
        5. Rebooting
        6. Boot Loader
          1. grub: The Linux Loader
          2. lilo: The Linux Loader (RHEL)
          3. LOADLIN: A DOS-Based Linux Loader
        7. dmesg: Display Kernel Messages
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
      6. 16. Administration Tasks
        1. Configuring User and Group Accounts
          1. system-config-users Manages User Accounts
          2. useradd: Adds a User Account
          3. userdel: Removes a User Account
          4. groupadd: Adds a Group
        2. Backing Up Files
          1. Choosing a Backup Medium
          2. Backup Utilities
            1. tar: Archives Files
            2. cpio: Archives Files
          3. Performing a Simple Backup
          4. dump, restore: Back Up and Restore Filesystems
        3. Scheduling Tasks
          1. cron and crontab: Schedule Routine Tasks
          2. at: Runs Occasional Tasks
          3. kcron: Schedules Tasks
        4. System Reports
          1. vmstat: Reports Virtual Memory Statistics
          2. top: Lists Processes Using the Most Resources
        5. Keeping Users Informed
        6. Creating Problems
          1. Failing to Perform Regular Backups
          2. Not Reading and Following Instructions
          3. Failing to Ask for Help When Instructions Are Not Clear
          4. Deleting or Mistyping a Critical File
        7. Solving Problems
          1. Helping When a User Cannot Log In
          2. Speeding Up the System
          3. lsof: Finds Open Files
          4. Keeping a Machine Log
          5. Keeping the System Secure
          6. Log Files and Mail for root
          7. Monitoring Disk Usage
          8. logrotate: Manages Log Files
          9. Removing Unused Space from Directories
          10. syslogd: Logs System Messages
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
      7. 17. Configuring a LAN
        1. Setting Up the Hardware
          1. Connecting the Computers
          2. Gateways and Routers
          3. Network Interface Card (NIC)
        2. Configuring the Systems
          1. system-config-network: Configuring the Hardware
          2. iwconfig: Configuring a Wireless NIC
        3. Setting Up Servers
        4. More Information
        5. Summary
        6. Exercises
        7. Advanced Exercises
    8. V. Using Clients and Setting Up Servers
      1. 18. OpenSSH: Secure Network Communication
        1. Introduction
        2. About OpenSSH
          1. Files
            1. /etc/ssh: Global Files
            2. ~/.ssh: User Files
          2. How OpenSSH Works
          3. More Information
        3. OpenSSH Clients
          1. Prerequisites
          2. JumpStart: Using ssh and scp
          3. Setup
            1. Recommended Settings
            2. Server Authentication/Known Hosts
          4. ssh: Connect to and Execute Commands on a Remote System
            1. Options
          5. scp: Copying a File from/to a Remote System
            1. Options
          6. sftp: A Secure FTP Client
          7. ~/.ssh/config and /etc/ssh/ssh_config Configuration Files
        4. sshd: OpenSSH Server
          1. Prerequisites
          2. JumpStart: Starting the sshd Daemon
            1. Recommended Settings
            2. Starting sshd for the First Time
          3. Authorized Keys: Automatic Login
          4. Command Line Options
          5. /etc/ssh/sshd_config Configuration File
        5. Troubleshooting
        6. Tunneling/Port Forwarding
        7. Chapter Summary
        8. Exercises
        9. Advanced Exercises
      2. 19. FTP: Transferring Files Across a Network
        1. Introduction
        2. More Information
        3. FTP Client
          1. Prerequisites
          2. JumpStart: Downloading Files Using ftp
            1. Basic Commands
            2. Tutorial Session
          3. Notes
          4. Anonymous FTP
          5. Automatic Login
          6. Binary versus ASCII Transfer Mode
          7. ftp Specifics
            1. Format
            2. Command Line Options
            3. ftp Commands
              1. Shell Command
              2. Transfer Files
              3. Status
              4. Directories
              5. Files
              6. Display Information
        4. FTP Server (vsftpd)
          1. Prerequisites
          2. Notes
          3. JumpStart: Starting a vsftpd Server
          4. Testing the Setup
          5. vsftpd.conf: Configuring vsftpd
            1. Standalone Mode
            2. Logging In
              1. Local Users
              2. Anonymous Users
            3. Working Directory and the chroot Jail
            4. Downloading and Uploading Files
              1. Download/Upload for Local Users
              2. Anonymous Users
            5. Messages
            6. Display
            7. Logs
            8. Connection Parameters
              1. Passive (PASV) Connections
              2. Active (PORT) Connections
              3. Timeouts
            9. Miscellaneous
            10. Files
        5. Chapter Summary
        6. Exercises
        7. Advanced Exercises
      3. 20. sendmail: Setting Up Mail Clients, Servers, and More
        1. Introduction
          1. Prerequisites
          2. More Information
        2. JumpStart I: Configuring sendmail on a Client
        3. JumpStart II: Configuring sendmail on a Server
        4. How sendmail Works
          1. Mail logs
          2. Aliases and Forwarding
          3. Related Programs
        5. Configuring sendmail
          1. The sendmail.mc and sendmail.cf Files
            1. Editing sendmail.mc and Generating sendmail.cf
            2. About sendmail.mc
            3. Masquerading
            4. Accepting Email from Unknown Hosts
            5. Setting Up a Backup Server
          2. Other Files in /etc/mail
            1. mailertable: Forwarding Email from One Domain to Another
            2. access: Setting Up a Relay Host
            3. virtusertable: Serving Email to Multiple Domains
        6. In Addition to sendmail
          1. SpamAssassin
          2. Webmail
          3. Mailing Lists
          4. Setting Up an IMAP or POP3 Server
          5. Setting Up KMail
        7. Authenticated Relaying
          1. Creating a Self-Signed Certificate
          2. Enabling SSL in sendmail
          3. Enabling SSL in the Mail Client
        8. Alternatives to sendmail
        9. Chapter Summary
        10. Exercises
        11. Advanced Exercises
      4. 21. NIS: Network Information Service
        1. Introduction to NIS
        2. How NIS Works
          1. More Information
        3. NIS Client Setup
          1. Prerequisites
          2. Notes
          3. Step-by-Step
            1. Specify the System’s NIS Domain Name
            2. /etc/yp.conf: Specify an NIS Server
            3. Start ypbind
          4. Test the Setup
          5. yppasswd: Changing NIS Passwords
            1. passwd versus yppasswd
            2. Modifying User Information
            3. Adding and Removing Users
        4. NIS Server Setup
          1. Prerequisites
          2. Notes
          3. Step-by-Step
            1. Specify the System’s NIS Domain Name
            2. Edit /etc/ypserv.conf to Configure the Server
              1. Options
              2. Access Rules
            3. Create /var/yp/securenets
            4. Edit /var/yp/Makefile
              1. Variables
              2. File Locations
              3. The all: Target
            5. ypinit: Build or Import the Maps
            6. Start the Servers
          4. Testing
          5. yppasswdd: NIS Password Update Daemon
            1. Start yppasswdd
            2. Allow GECOS and Login Shell Modification
        5. Chapter Summary
        6. Exercises
        7. Advanced Exercises
      5. 22. NFS: Sharing Filesystems
        1. Introduction
        2. More Information
        3. NFS Client
          1. Prerequisites
          2. JumpStart: Mounting a Remote Directory Hierarchy
            1. mount: Mounts a Remote Directory Hierarchy
            2. umount: Unmounts a Remote Directory Hierarchy
          3. mount: Mounts a Directory Hierarchy
            1. Attribute Caching
            2. Error Handling
            3. Miscellaneous Options
          4. Improving Performance
          5. /etc/fstab: Mounts Directory Hierarchies Automatically
        4. NFS Server
          1. Prerequisites
          2. JumpStart: system-config-nfs: Configures an NFS Server
          3. Exporting a Directory Hierarchy
            1. /etc/exports: List of Exported Directory Hierarchies
            2. General Options
            3. User ID Mapping Options
            4. showmount: Displays NFS Status Information
          4. exportfs: Maintains the List of Exported Directory Hierarchies
            1. Options
          5. Testing the Server Setup
        5. automount: Mounting Directory Hierarchies Automatically
          1. Prerequisites
            1. More Information
            2. autofs: Automatically Mounts Directory Hierarchies
        6. Chapter Summary
        7. Exercises
        8. Advanced Exercises
      6. 23. Samba: Integrating Linux and Windows
        1. Which Version of Samba?
        2. Introduction
        3. About Samba
          1. Prerequisites
          2. More Information
          3. Samba Users, User Maps, and Passwords
        4. JumpStart: system-config-samba: Configuring a Samba Server
        5. swat: Configuring a Samba Server
        6. Manually Configuring a Samba Server
          1. Parameters in the smbd.conf File
            1. Global Parameters
            2. Security Parameters
            3. Logging Parameters
            4. Browser Parameters
            5. Communication Parameters
            6. Share Parameters
          2. The [homes] Share: Sharing Users’ Home Directories
        7. Accessing Linux Shares from Windows
          1. Browsing Shares
          2. Mapping a Share
        8. Accessing Windows Shares from Linux
          1. smbtree: Displaying Windows Shares
          2. smbclient: Connecting to Windows Shares
          3. Browsing Windows Networks
          4. smbmount: Mounting Windows Shares
        9. Troubleshooting
        10. Chapter Summary
        11. Exercises
        12. Advanced Exercises
      7. 24. DNS/BIND: Tracking Domain Names and Addresses
        1. Introduction to DNS
          1. Nodes, Domains, and Subdomains
          2. Zones
          3. Queries
          4. Servers
          5. DNS Database
            1. Resource Records
          6. DNS Query and Response
          7. Reverse Name Resolution
        2. About DNS
          1. How DNS Works
          2. Prerequisites
          3. More Information
        3. JumpStart I: Setting Up a DNS Cache
        4. JumpStart II: system-config-bind: Setting Up a Domain
        5. Setting Up BIND
          1. named.conf
            1. IP-list
            2. Comments
            3. Options Section
            4. Zone Section
          2. Zone Files
            1. Time Formats
            2. Domain Qualification
            3. Zone File Directives
          3. A DNS Cache
            1. Zone Files
          4. DNS Glue
          5. TSIG (Transaction Signatures)
            1. Creating a Secret Key
            2. Using the Shared Secret
          6. Running BIND Inside a chroot Jail
        6. Troubleshooting
        7. A Full-functioned Nameserver
        8. A Slave Server
        9. A Split Horizon Server
        10. Chapter Summary
        11. Exercises
        12. Advanced Exercises
      8. 25. iptables: Setting Up a Firewall
        1. How iptables Works
        2. About iptables
          1. More Information
          2. Prerequisites
          3. Notes
        3. JumpStart: Using system-config-securitylevel to Build a Firewall
        4. Anatomy of an iptables Command
        5. Building a Set of Rules
          1. Commands
          2. Packet Match Criteria
          3. Display Criteria
          4. Match Extensions
            1. Implicit Match Extensions
            2. TCP
            3. UDP
            4. ICMP
            5. Explicit Match Extensions
            6. State
          5. Targets
          6. Copying Rules to and from the Kernel
        6. A Rule Set Generated by system-config-securitylevel
        7. Sharing an Internet Connection Using NAT
          1. Connecting Several Clients to a Single Internet Connection
          2. Connecting Several Servers to a Single Internet Connection
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
      9. 26. Apache (httpd): Setting Up a Web Server
        1. Introduction
        2. About Apache
          1. Prerequisites
          2. More Information
          3. Notes
        3. JumpStart I: Getting Apache Up and Running
          1. Modifying the httpd.conf Configuration File
          2. Testing Apache
          3. Putting Your Content in Place
        4. JumpStart II: Setting Up Apache with system-config-httpd
        5. Filesystem Layout
        6. Configuration Directives
          1. Directives I: Directives You May Want to Modify As You Get Started
          2. Contexts and Containers
            1. Contexts
            2. Containers
          3. Directives II
            1. Directives That Control Processes
            2. Networking Directives
            3. Logging Directives
            4. Directives That Control Content
            5. Configuration Directives
            6. Security Directives
        7. The Red Hat httpd.conf File
          1. Section 1: Global Environment
          2. Section 2: Main Server Configuration
          3. Section 3: Virtual Hosts
        8. Redirects
        9. Multiviews
        10. Server Generated Directory Listings (Indexing)
        11. VirtualHosts
        12. Troubleshooting
        13. Modules
          1. Module List
          2. mod_cgi and CGI Scripts
          3. mod_ssl
            1. Setting Up mod_ssl
            2. Using a Self-Signed Certificate for Encryption
            3. Notes on Certificates
          4. Authentication Modules and .htaccess
          5. Scripting Modules
        14. webalizer: Analyzing Web Traffic
        15. MRTG: Monitoring Traffic Loads
        16. Error Codes
        17. Chapter Summary
        18. Exercises
        19. Advanced Exercises
    9. VI. Programming
      1. 27. Programming Tools
        1. Programming in C
          1. Checking Your Compiler
          2. A C Programming Example
          3. Compiling and Linking a C Program
        2. Using Shared Libraries
          1. Fixing Broken Binaries
          2. Creating Shared Libraries
        3. make: Keeps a Set of Programs Current
          1. Implied Dependencies
        4. Debugging C Programs
          1. gcc: Compiler Warning Options Find Errors in Programs
          2. Symbolic Debugger
            1. gdb: Symbolic Debugger
            2. Graphical Symbolic Debuggers
        5. Threads
        6. System Calls
          1. strace: Traces System Calls
          2. Controlling Processes
          3. Accessing the Filesystem
        7. Source Code Management
          1. CVS: Concurrent Versions System
            1. Built-in CVS Help
            2. How CVS Stores Revision Files
            3. Basic CVS Commands
              1. Checking Out Files from the Source Repository
              2. Making Your Changes Available to Others
              3. Updating Your Copies with Changes by Others
              4. Adding New Files to the Repository
              5. Removing Files from the Repository
            4. Other CVS Commands
              1. Tagging a Release
              2. Extracting a Release
              3. Removing Working Files
            5. Adding a Module to the Repository
            6. CVS Administration
            7. Using tkcvs
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
      2. 28. Programming the Bourne Again Shell
        1. Control Structures
          1. if...then
          2. if...then...else
          3. if...then...elif
            1. The lnks Script
            2. Debugging Shell Scripts
          4. for...in
          5. for
            1. The whos Script
          6. while
            1. The spell_check Script
          7. until
          8. break and continue
          9. case
          10. select
          11. Here Document
        2. Expanding Null or Unset Variables
          1. :– Uses a Default Value
          2. := Assigns a Default Value
          3. :? Displays an Error Message
        3. String Pattern Matching
        4. Filename Generation
        5. Builtins
          1. exec: Executes a Command
          2. trap: Catches a Signal
          3. A Partial List of Builtins
        6. Functions
        7. Chapter Summary
        8. Exercises
        9. Advanced Exercises
    10. VII. Appendixes
      1. A. Regular Expressions
        1. Characters
        2. Delimiters
        3. Simple Strings
        4. Special Characters
          1. Periods
          2. Brackets
          3. Asterisks
          4. Carets and Dollar Signs
          5. Quoting Special Characters
        5. Rules
          1. Longest Match Possible
          2. Empty Regular Expressions
        6. Bracketing Expressions
        7. The Replacement String
          1. Ampersand
          2. Quoted Digit
        8. Extended Regular Expressions
        9. Appendix Summary
          1. Special Characters
          2. Character Classes and Bracketed Regular Expressions
          3. Extended Regular Expressions
          4. Replacement Strings
      2. B. Help
        1. Solving a Problem
        2. Finding Linux-Related Information
          1. Documentation
          2. Useful Linux Sites
          3. Linux Newsgroups
          4. Mailing Lists
          5. Words
          6. Software
          7. Office Suites and Word Processors
        3. Specifying a Terminal
      3. C. Security
        1. Encryption
          1. Public Key Encryption
          2. Symmetric Key Encryption
          3. Encryption Implementation
          4. GnuPG/PGP
        2. File Security
        3. Email Security
          1. MTAs (Mail Transfer Agents)
          2. MUAs (Mail User Agents)
        4. Network Security
          1. Network Security Solutions
          2. Network Security Guidelines
        5. Host Security
          1. Login Security
          2. Remote Access Security
          3. Viruses and Worms
          4. Physical Security
        6. Security Resources
        7. Appendix Summary
      4. D. The Free Software Definition
      5. E. The Linux 2.6 Kernel
        1. Native Posix Thread Library (NPTL)
        2. IPSecurity (IPSec)
        3. Asynchronous I/O (AIO)
        4. O(1) Scheduler
        5. OProfile
        6. kksymoops
        7. Reverse Map Virtual Memory (rmap VM)
        8. HugeTLBFS (Translation Look-Aside Buffer File System)
        9. Remap_file_pages
        10. 2.6 Network Stack Features (IGMPv3, IPv6, and Others)
        11. Internet Protocol Virtual Server (IPVS)
        12. Access Control Lists (ACLs)
        13. 4GB-4GB Memory Split: Physical Address Extension (PAE)
        14. Scheduler Support for HyperThreaded CPUs
        15. Block I/O (BIO) Block Layer
        16. Support for > 2TB Filesystem
        17. New I/O Elevators
        18. Interactive Scheduler Response Tuning
    11. Glossary