You are previewing RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302), 5th Edition.
O'Reilly logo
RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302), 5th Edition

Book Description

The Best Fully Integrated Study System Available

With hundreds of practice questions and hands-on exercises, RHCE Red Hat Certified Engineer Linux Study Guide, Fifth Edition covers what you need to know--and shows you how to prepare--for this challenging exam.

  • 100% complete coverage of all objectives for exam RH302
  • Exam Readiness Checklist at the front of the book--you're ready for the exam when all objectives on the list are checked off
  • Inside the Exam sections in every chapter highlight key exam topics covered
  • Real-world exercises modeled after hands-on exam scenarios
  • Two complete lab-based exams simulate the format, tone, topics, and difficulty of the real exam
  • Bonus content (available for download) includes installation screen review, basic instructions for using VMware and Xen as testbeds, and paper and pencil versions of the lab exams

Covers all RH302 exam topics, including:

  • Hardware installation and configuration
  • The boot process
  • Linux filesystem administration
  • Package management and Kickstart
  • User and group administration
  • System administration tools
  • Kernel services and configuration
  • Apache and Squid
  • Network file sharing services (NFS, FTP, and Samba)
  • Domain Name System (DNS)
  • E-mail (servers and clients)
  • Extended Internet Services Daemon (xinetd), the Secure package, and DHCP
  • The X Window System
  • Firewalls, SELinux, and troubleshooting

Table of Contents

  1. Cover
  2. Title Page
  3. Copyright Page
  4. Dedication
  5. About the Contributors
  6. Contents
  7. Acknowledgments
  8. Preface
  9. Introduction
  10. 1 RHCE Prerequisites
    1. Basic Hardware Knowledge
      1. Architectures
      2. Intel Communications Channels
      3. RAM Requirements
      4. Hard Drive Options
    2. Basic Linux Knowledge
      1. The VIsual Editor
      2. Exercise 1-1: Using vi to Create a New User
      3. Other Text Editors
    3. Linux Filesystem Hierarchy and Structure
      1. Linux Filesystems and Directories
      2. A Variety of Media Devices
      3. Making Reference to Devices in /dev
      4. Filesystem Formatting and Checking
      5. Configuring One Filesystem on Multiple Partitions
      6. Exercise 1-2: Creating a New LVM Partition
      7. Mounting Other Partitions
    4. Basic File Operations and Manipulation
      1. Basic File Operations
      2. File Filters
      3. Administrative Commands
      4. Wildcards
    5. Printing
      1. Adding Printers
      2. Print Commands
    6. Shells
      1. Basic Shell Programming
      2. Variables and Parameters
      3. Exercise 1-3: Checking the PATH
      4. Script Execution and Permissions
      5. Inherited Environment
      6. Piping, Input/Output, Error, and Redirection
    7. Basic Security
      1. File Permissions
      2. Users, Groups, and umask
      3. SUID and SGID
      4. Shadow Passwords
      5. Shadow Password Suite
    8. System Administration
      1. The Superuser
      2. /etc/skel for Home Directories
      3. Daemons
      4. Controlling Network Services Through Daemons
      5. cron
      6. Backup and Restore
      7. System Log File Management
    9. Basic TCP/IP Networking
      1. IP Numbers and Address Classes
      2. IPv6 Addressing
      3. How to Define a Network with IP Addresses
      4. Tools and Commands
      5. Configuring Name Resolution
    10. Familiarity with Standard Network Services
      1. Network File System, Locally and Remotely
      2. sendmail and Postfix
      3. POP, IMAP
      4. File Transfer Protocol (FTP)
      5. Domain Name Service (DNS)
      6. Dynamic Host Configuration Protocol (DHCP)
      7. Samba
      8. Web Services
      9. Network Information Service (NIS)
      10. The Extended Internet Services Daemon (xinetd)
    11. Basic Network Security
      1. Allowing and Denying
      2. Securing Ports
      3. Network Address Translation
      4. iptables
    12. Other Basic Prerequisite Skills per the Red Hat Exam Prep Guide
      1. Configuring an email Client
      2. Using a Text and/or Graphical Browser to Access HTTP/HTTPs URLs
      3. Using lftp to Access URLs
    13. Downloading the Red Hat Enterprise Linux Installation CDs
      1. Downloading Red Hat Enterprise Linux
      2. Red Hat Enterprise Linux Source RPMs
      3. Third-Party Rebuilds
      4. The Fedora Core 5/6 Prep Option
      5. An Overview of the Download Process
      6. Two-Minute Drill
    14. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  11. 2 Hardware and Installation
    1. Hardware Compatibility
      1. Linux Hardware Documentation
      2. Plug and Play and the Hardware Abstraction Layer
      3. ACPI and APM
    2. CPU and RAM
      1. Compatible CPUs
      2. CPUs and Virtualization
      3. RAM Requirements
    3. Hotswap Buses
      1. Serial Ports
      2. Parallel Ports
      3. USB
      4. IEEE 1394
      5. PC Card (PCMCIA)
      6. Hotswap Systems
      7. Device Management
    4. Configuring a Network Installation
      1. Configuring a Network Installation Server
      2. Creating an NFS Installation Server
      3. Configuring Another Network Installation Server
      4. Requirements for Network Installations
      5. Setting Up Installation from a Local Hard Drive
    5. The First Installation Steps
      1. Boot Options
      2. Booting from the First CD/DVD
      3. If You Need an Installation USB or CD/DVD
      4. Almost Ready to Install
      5. CD/DVD or Boot USB Starts Installation
      6. First Selections
    6. Configuring Partitions, RAID, and LVM
      1. RAID, Briefly
      2. Logical Volumes, Briefly
      3. Naming Conventions
      4. Exercise 2-1: Partitioning
      5. Exercise 2-2: Partitioning During Installation
      6. Separate Filesystems
      7. Stability and Security
      8. Basic Storage Space Requirements
      9. Linux Swap Space
      10. BIOS Limits
      11. Multiple Controllers
    7. Post-partition Installation Steps
      1. The Boot Loader
      2. Networking
      3. Time and Root Passwords
      4. Baseline Packages
      5. Package Groups
    8. Post-installation, Security, and the First Boot Process
      1. Licensing
      2. Initial Firewall Configuration
      3. Initial SELinux Configuration
      4. kdump
      5. Date and Time
      6. Set Up Software Updates
      7. The First Regular User
      8. Password Security
      9. Sound Card Configuration
      10. Additional CDs
      11. If You Haven’t Configured the GUI
      12. Caveat Emptor on Installation
    9. Installation Validation
      1. The Installation Log File
      2. Installation Troubleshooting
    10. Certification Summary
      1. Two-Minute Drill
    11. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  12. 3 The Boot Process
    1. The BIOS Initialization Sequence
      1. Basics of the BIOS
      2. Using the BIOS Menu
      3. The BIOS and the Boot Loader
    2. The GRUB Boot Loader
      1. GRUB, the GRand Unified Bootloader
      2. GRUB Parameters
      3. Updating GRUB
      4. GRUB Error Effects
      5. Exercise 3-1: GRUB Error Effects
      6. The GRUB Command Line
      7. Exercise 3-2: Using the GRUB Command Line
    3. Kernel Initialization and the First Process
      1. Kernel Message Analysis
      2. Driver Loading
    4. The First Process and /etc/inittab
      1. The First Process
      2. /etc/inittab
      3. Virtual Consoles
    5. Runlevels
      1. Functionality of Each Runlevel
      2. Runlevel Scripts
      3. Booting into the Runlevel of Your Choice
      4. Exercise 3-3: Booting into a Different Runlevel
    6. Controlling Services
      1. Service Control from the Command Line
      2. The Text Console Service Configuration Tool
      3. The GUI Service Configuration Tool
    7. System Configuration Files
      1. Non-network /etc/sysconfig Files
      2. GUI Configuration Utilities
      3. Two-Minute Drill
    8. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  13. 4 Linux Filesystem Administration
    1. Partitioning Hard Disks
      1. The fdisk Utility
      2. The parted Utility
    2. Managing Filesystems
      1. Standard Formatting Filesystems
      2. Understanding Journaling Filesystems
      3. Creating Filesystems with mkfs
      4. Managing ext2/ext3 Filesystem Attributes
    3. Filesystem Management and the Automounter
      1. Managing /etc/fstab
      2. Mounting Filesystems, Actively
      3. Mounting USB Keys and Removable Media
      4. Mounting via the Automounter
      5. Exercise 4-1: Configuring the Automounter
    4. A Floppy Drive and the Automounter
    5. Access Control Lists and Other Security Attributes
      1. Access Control Lists
      2. Understanding SELinux
      3. Two-Minute Drill
    6. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  14. 5 Package Management
    1. The Red Hat Package Manager
      1. What Is a Package?
      2. What Is an RPM?
      3. Installing RPMs
      4. Removing RPMs
      5. Installing RPMs from Remote Systems
      6. Updating a Kernel RPM
    2. More RPM Commands
      1. RPM Queries
      2. Validating an RPM Package Signature
      3. RPM Verification
      4. Listing Installed RPMs
      5. Using RPM Sources
    3. Managing Updates with Pup and the Red Hat Network
      1. RHN Registration
      2. Updating with Pup
      3. Automatic Dependency Resolution
      4. RHN in the Enterprise
    4. Adding and Removing RPM Packages with yum and pirut
      1. The Basics of yum
      2. Install Mode
      3. Updates and Security Fixes
      4. Third-Party Repositories
      5. Managing with pirut
      6. Exercise 5-1: Installing More with pirut
    5. Using Kickstart to Automate Installation
      1. Kickstart Concepts
      2. Setting Up a Kickstart USB
      3. Configuring a Kickstart Server
      4. Starting the Installation with a Kickstart File
      5. Sample Kickstart File
      6. Kickstart Partitioning
      7. Exercise 5-2: Creating a Sample Kickstart File
    6. Modifying the Packages to be Installed
      1. The Kickstart Configurator
      2. Two-Minute Drill
    7. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  15. 6 User Administration
    1. User Account Management
      1. User Account Categories
      2. Basic Command Line Tools
      3. The Red Hat User Manager
      4. Exercise 6-1: Adding a User with the Red Hat User Manager
      5. User Account Management Tips
      6. Deleting a User Account
      7. Modifying a User Account
      8. Regular User Management Commands
      9. Limiting Access to su
      10. Limiting Access to sudo
    2. The Basic User Environment
      1. Home Directories and /etc/skel
      2. Window Manager Configuration Files
    3. Shell Configuration Files
      1. /etc/bashrc
      2. /etc/profile
      3. /etc/profile.d/
      4. Exercise 6-2: Securing Your System
      5. User Shell Configuration Files
    4. Setting Up and Managing Disk Quotas
      1. Quota Settings in the Kernel
      2. The Quota Package
      3. sysinit Quota Handling
      4. Quota Activation in /etc/fstab
      5. Quota Management Commands
      6. Using edquota to Set Up Disk Quotas
      7. Automating Quota Settings
      8. Quota Reports
      9. Quotas on NFS Directories
      10. Exercise 6-3: Configuring Quotas
    5. Creating and Maintaining Special Groups
      1. Standard and Red Hat Groups
      2. Shared Directories
      3. Exercise 6-4: Controlling Group Ownership with the SGID Bit
    6. Pluggable Authentication Modules
      1. Pluggable Authentication Modules (PAM) and Associated Files
      2. PAM Configuration Example: /etc/pam.d/login
      3. Exercise 6-5: Configuring PAM
      4. Securing PAM by User
      5. Exercise 6-6: Using PAM to Limit Access
    7. Network Authentication Configuration: NIS and LDAP
      1. NIS Client Configuration
      2. LDAP Client Configuration
      3. The Name Service Switch File
      4. Configuring Clients with the Red Hat Authentication Tool
      5. Two-Minute Drill
    8. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  16. 7 System Administration Tools
    1. Network Configuration
      1. The /etc/sysconfig/network-scripts Files
      2. Setting Up a Network Interface
      3. Exercise 7-1: Modifying Network Interfaces with system-config-network
    2. The CUPS Printing System
      1. Installing and Starting CUPS
      2. CUPS Configuration Files
      3. The Red Hat Printer Configuration Tool
      4. The Line Print Daemon Commands
      5. The CUPS Web-Based Interface
      6. Verifying CUPS Sharing
      7. CUPS and SELinux
    3. Automating System Administration: cron and at
      1. The System crontab and Components
      2. Setting Up cron for Users
      3. Exercise 7-2: Creating a cron Job
      4. Running a Job with the at System
      5. Securing cron and at
    4. Understanding, Maintaining, and Monitoring System Logs
      1. System Log Configuration File
      2. Managing Logs
      3. Exercise 7-3: Checking Logs
      4. Two-Minute Drill
    5. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  17. 8 Kernel Services and Configuration
    1. The Basics of the Kernel
      1. Best Practices
      2. Kernel Concepts
      3. Other RHEL Kernels
      4. The /boot Partition
      5. The /proc Filesystem
      6. Understanding Kernel Modules
      7. The /lib/modules/kernel_version/ Directory Structure
    2. New Kernels, the Easy Way
      1. Understanding Kernel Version Numbers
      2. Upgrading Kernels
      3. Kernel Patches
      4. Updating GRUB
    3. Kernel Sources
      1. The Kernel Source Tree and Documentation
      2. The Kernel RPMs
      3. The Linux Kernel tar File
    4. Recompiling a Kernel
      1. The Kernel Configuration Scripts
      2. Understanding Kernel Configuration Options
      3. Exercise 8-1: Compiling and Installing a Custom Kernel
    5. Advanced Partitioning: Software RAID
      1. RAID 0
      2. RAID 1
      3. RAID 4
      4. RAID 5
      5. RAID 6
      6. RAID 10
      7. RAID in Practice
      8. Exercise 8-2: Mirroring the /home Partition with Software RAID
    6. Advanced Partitioning: Logical Volume Management
      1. Creating a Physical Volume
      2. Creating a Volume Group
      3. Creating a Logical Volume
      4. Using a Logical Volume
      5. More LVM Commands
      6. Adding Another Logical Volume
      7. Removing a Logical Volume
      8. Resizing Logical Volumes
      9. The GUI LVM Management Tool
      10. Converting LVM1 Filesystem to LVM2
      11. Two-Minute Drill
    7. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  18. 9 Apache and Squid
    1. The Apache Web Server
      1. Apache 2.2
      2. Installation
      3. Starting on Reboot
      4. Exercise 9-1: Installing the Apache Server
      5. The Apache Configuration Files
      6. Analyzing the Default Apache Configuration
      7. Analyzing httpd.conf
      8. Basic Apache Configuration for a Simple Web Server
    2. Apache Access Configuration
      1. Basic Apache Security
      2. Apache and Security Arrangements
      3. Exercise 9-2: Creating a List of Files
      4. Host-Based Security
      5. User-Based Security
      6. Control Through .htaccess
      7. Exercise 9-3: Password Protection for a Web Directory
    3. Virtual Hosts
      1. Virtual Hosts
      2. Secure Virtual Hosts
      3. Checking Syntax
      4. Executable Files in Apache
      5. Apache Log Files
      6. Apache Troubleshooting
      7. Exercise 9-4: Updating a Home Page
      8. Exercise 9-5: Setting Up a Virtual Web Server
      9. The Red Hat httpd Configuration Tool
    4. The Squid Web Proxy Cache
      1. Key Squid Files and Directories
      2. Starting Squid on Reboot
      3. Basic Squid Configuration
      4. Configuration Options
      5. Security Options
      6. Exercise 9-6: Configuring Squid to Act as a Proxy Server
      7. Two-Minute Drill
    5. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  19. 10 Network File-Sharing Services
    1. Configuring a Network File System (NFS) Server
      1. NFS Server Configuration and Operation
      2. Required Packages
      3. Configuring NFS to Start
      4. Configuring NFS for Basic Operation
      5. NFS Server Configuration Tool
      6. Making NFS Work with SELinux
      7. Quirks and Limitations of NFS
      8. Performance Tips
      9. NFS Security
      10. Exercise 10-1; NFS
      11. Exercise 10-2: Using the NFS Server Configuration Tool
    2. Client-Side NFS
      1. Mounting an NFS Directory from the Command Line
      2. Client-Side Helper Processes
      3. NFS and /etc/fstab
      4. Diskless Clients
      5. Soft Mounting
    3. The File Transfer Protocol and vsFTPd
      1. Installing the Very Secure FTP Server
      2. Configuring SELinux Support for vsFTP
      3. Starting on Reboot
      4. vsFTP Server Security
      5. Exercise 10-3: Configuring a Basic vsFTP Server
    4. Samba Services
      1. Installing Samba Services
      2. Configuring SELinux Support for Samba
      3. Configuring Samba to Start
      4. Some Samba Background
      5. Configuring Samba as a Client
      6. Configuring a Samba Server
      7. Joining a Domain
      8. Configuring Samba Users
      9. Exercise 10-4: Using Home Directories
      10. The Red Hat Samba Server Configuration Utility
      11. Testing Changes to /etc/samba/smb.conf
      12. Exercise 10-5: Configuring Samba with Shares
      13. Two-Minute Drill
    5. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  20. 11 Domain Name Service
    1. Understanding DNS: Zones, Domains, and Delegation
      1. Basic Parameters
      2. Packages
      3. A DNS Client
    2. The Berkeley Internet Name Domain (BIND)
      1. The DNS Configuration Files
      2. A Caching-Only Name Server
      3. A Slave Name Server
      4. A Forwarding-Only Name Server
      5. named.ca
      6. localhost.zone
      7. Reverse Lookups with named.local
      8. Configuring a Simple Domain
      9. Creating an RNDC Key
      10. Creating a Zone File
      11. The Reverse Zone
      12. Starting named
      13. Common DNS Pitfalls
    3. BIND Utilities
      1. BIND Commands
      2. The DNS Configuration Tool
      3. Exercise 11-1: Setting up Your Own DNS Server
      4. Two-Minute Drill
    4. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  21. 12 Electronic Mail
    1. Mail Transport Agents, Mail Delivery Agents, and Mail User Agents
      1. Definitions
      2. Installing Mail Server Packages
    2. Reception with Dovecot
      1. POP
      2. IMAP
      3. Configuration File
      4. Activating Dovecot
      5. Dovecot Secure Certificates
    3. sendmail Configuration
      1. Configuring sendmail for Basic Operation
    4. Configuring and Activating Postfix
    5. Selecting an E-mail System
      1. Using alternatives to Select an E-mail System
      2. Switching with system-switch-mail
      3. E-mail Clients
      4. Testing the Results
      5. Exercise 12-1: Testing E-mail Services
      6. Two-Minute Drill
    6. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  22. 13 Other Networking Services
    1. The Extended Internet Services Daemon (xinetd)
      1. Generic xinetd Configuration
      2. Sample xinetd Configuration
      3. Exercise 13-1: Configuring xinetd
    2. The Secure Shell Package
      1. Basic Encrypted Communication
      2. How to Generate Your Keys
      3. Why Use SSH?
      4. Configuring an SSH Server
      5. Configuring an SSH Client
    3. Dynamic Host Configuration Protocol (DHCP)
      1. Installing DHCP Packages
      2. DHCP Server Configuration
      3. Client Configuration
      4. Exercise 13-3: Configuring DHCP
    4. The Network Time Protocol (NTP)
      1. NTP Client Configuration
      2. Basic Configuration
      3. Configuring a Local NTP Server
      4. Two-Minute Drill
    5. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  23. 14 The X Window System
    1. X with Clients and Servers
      1. Different Meanings for Client and Server
      2. Supported Hardware
      3. Default X Clients
      4. Exercise 14-1: Starting X Server
      5. X Clients and Command Line Options
      6. xterm
    2. The X.org Server Configuration
      1. X.org Server Configuration Files
      2. Starting the X Window
      3. Exercise 14-2: Starting Multiple X Servers
      4. xorg.conf in Detail
      5. Text or Graphical GUI Access
      6. Text Login Mode
      7. Display Managers: gdm and kdm
      8. Analyzing startx
      9. Exercise 14-3: Customizing the startx Process
    3. Tools for X.org Configuration
      1. Red Hat Display Settings Tool
      2. Other Available Tools
      3. X Font Server Issues
    4. Running Remote X Applications
      1. Exercise 14-4: Starting a Display from a Remote Client
      2. Troubleshooting
    5. Desktops and Window Managers
      1. The GNOME and KDE Desktops
      2. Default Desktop
      3. Exercise 14-5: Exploring Desktops
      4. Two-Minute Drill
    6. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  24. 15 Securing Services
    1. Using tcp_wrappers to Secure Services
      1. Security by User or Host
      2. Exercise 15-1: Configuring tcp_wrappers
    2. Firewalls and Packet Filtering Using netfilter
      1. Configuring iptables
      2. Maintaining Netfilter Rules
      3. The Red Hat Firewall Configurator
    3. Network Address Translation
      1. IP Masquerading
      2. IP Forwarding
    4. Security Enhanced Linux
      1. SELinux Status
      2. Configuring Manually
      3. Configuring with the SELinux Management Tool
      4. The Setroubleshoot Browser
      5. Two-Minute Drill
    5. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  25. 16 Troubleshooting
    1. Troubleshooting Strategies
      1. Booting Into Different Runlevels
      2. The linux rescue Environment
    2. Required RHCT Troubleshooting Skills
      1. Diagnosing and Correcting Network Problems
      2. Exercise 16-1: Diagnosing and Correcting Network Problems
      3. Diagnosing and Correcting Hostname Resolution Problems
      4. Exercise 16-2: Diagnosing and Correcting Hostname Resolution Problems
      5. Configuring the X Window System
      6. Exercise 16-3: Configuring the X Window System
      7. Configuring a Desktop Environment
      8. Exercise 16-4: Configuring a Desktop Environment
      9. Adding New Partitions, Filesystems, and Swap
      10. Exercise 16-5: Adding a New Partition
      11. Important Command Line Tools
    3. Required RHCE Troubleshooting Skills
      1. Troubleshooting the Boot Loader
      2. Exercise 16-6: Troubleshooting the Boot Loader
      3. Module Errors
      4. Exercise 16-7: Troubleshooting Boot Loader Modules
      5. Filesystem Corruption and Checking
      6. File Corruption
      7. Network Service Issues
      8. Add, Remove, and Resize Logical Volumes
      9. Diagnosing SELinux-related Network Service Issues
      10. Two-Minute Drill
    4. Q&A Self Test
      1. Lab Questions
      2. Self Test Answers
      3. Lab Answers
  26. A Sample Exam 1
    1. Troubleshooting and System Maintenance
      1. Troubleshooting and System Maintenance Exercise: RHCT Components
      2. Troubleshooting and System Maintenance: RHCE Components
      3. Troubleshooting and System Maintenance Discussion
    2. Installation and Configuration
      1. Server Installation Problem: RHCT-Level Skills
      2. Server Installation Problem: RHCE-Level Skills
      3. Installation Discussion
  27. B Sample Exam 2
    1. Troubleshooting and System Maintenance
      1. Troubleshooting and System Maintenance Exam: RHCT Components
      2. Troubleshooting and System Maintenance: RHCE Components
      3. Troubleshooting and System Maintenance Discussion
    2. Installation and Configuration
      1. Server Installation Problem: RHCT-Level Skills
      2. Server Installation Problem: RHCE-Level Skills
      3. Installation Discussion
  28. Glossary
  29. Index