You are previewing LPIC-1 In Depth.
O'Reilly logo
LPIC-1 In Depth

Book Description

GNU/Linux certifications, and in particular Linux Professional Institute (LPI) certification, are increasingly becoming a key differentiator between IT job candidates. "LPIC-1 In Depth" offers the most up-to-date test prep guide available to successfully pass both Linux Professional Institute Level I exams, LPIC-1 101 and 102. Each chapter maps completely to a section of the test, and includes end of the chapter review questions and answers. The appendices include a full glossary of terms and two sample exams for self-testing.

Table of Contents

  1. Copyright
    1. Dedication
  2. Acknowledgments
  3. About the Author
  4. Introduction
    1. Suggested Linux Distributions
    2. What You’ll Find in This Book
    3. Who This Book Is For
    4. How This Book Is Organized
    5. How to Prepare for the LPIC-1 Exams
    6. How to Become LPIC-1 Certified
    7. On the Day of the Exam
  5. I. LPI Exam 101
    1. 1. System Architecture
      1. Introduction
      2. A Brief Overview of Linux and the LPI Exams
        1. Current Requirements
        2. Target Distributions
      3. Determine Hardware and Configure Settings
        1. The Hardware Abstraction Layer and the Daemon
          1. The System Filesystem and/sys Directories
          2. The /proc Directories
          3. The udev System and the /dev Directory
          4. Set the Correct Hardware ID for Different Devices, Especially the Boot Device
          5. The dbus System
        2. Currently Detected Hardware
        3. Peripheral Management
          1. Peripheral Driver Management
          2. Different Types of Mass Storage Devices
            1. Internal Hard Drives
            2. External Mass Storage Devices
      4. Boot the System
        1. Use the GRUB Boot Loader Menu
        2. Change GRUB Boot Loader Options
        3. Review the Boot Process
        4. Boot Process Log Files
      5. Service Setting Management
        1. Organized Runlevels
        2. Manage by Runlevel
          1. Alert Users Prior to Shutdown
          2. Move to Single User Mode
          3. Shut Down and Reboot from the Command Line
          4. Properly Terminate a Process
        3. Manage by Upstart
      6. Chapter Summary
      7. Key Terms
      8. Review Questions
    2. 2. Configure a System for Linux
      1. Introduction
      2. Manage a Hard Disk
        1. Appropriate Directory Mount Points
        2. Tailored Mount Point Design
          1. Basic Linux System
          2. File Server
          3. Web Server
        3. Hard Disk Options
        4. Partitions, Logical Volumes, and RAID Arrays
          1. Hard Disk Partitions
          2. Logical Volumes
          3. RAID Arrays
          4. Special Issues with the /boot Directory
          5. Swap Space
      3. The Boot Manager
        1. Backup Boot Options
        2. Install, Configure, and Interact with GRUB
          1. Install GRUB
          2. Configure GRUB
          3. Interact with GRUB
        3. Install and Interact with LILO
          1. Install LILO
          2. Interact with LILO
      4. Set Up Shared Libraries
        1. Identify Required Library Files
        2. Library Configuration
        3. Library File Directories
      5. Chapter Summary
      6. Key Terms
      7. Review Questions
    3. 3. Package Management Systems
      1. Introduction
      2. Debian Package Management Parameters
        1. The dpkg Command
        2. Reconfigure a Package
      3. The Power of apt
        1. Basic apt Commands
          1. The apt-get Command
          2. The apt-cache Command
          3. The apt-file Command
        2. The apt Configuration File
        3. The aptitude Alternative
      4. Red Hat Package Management Parameters
        1. The rpm Command
          1. Verify a Package Signature
          2. Verify Package Contents
        2. Queries and More with rpm
        3. Conversions with rpm2cpio and alien
          1. The rpm2cpio Command
          2. The alien Command
      5. The Power of yum
        1. Basic yum Commands
        2. The yum Configuration Files
        3. Third-Party Repositories
      6. Chapter Summary
      7. Key Terms
      8. Review Questions
    4. 4. Command Lines and Files
      1. Introduction
      2. The Structure of the Shell
        1. A bash Shell Environment
          1. bash
          2. env
          3. export to Set an Environment Variable
          4. unset
        2. Dots and Directories
        3. Commands and the PATH
        4. Command Completion
        5. Basic Shell Commands
          1. pwd
          2. man
          3. uname
          4. exec Runs Apart from a Shell
        6. Basic Command History
      3. Basic File Management
        1. Linux Wildcards and Globbing
        2. Create and Manage Files and Directories
          1. file Lists File Types
          2. touch Sets File Times and Creates a New Empty File
          3. ls for List
          4. cp for Copy
          5. mv for Move
          6. rm for Remove
          7. Create and Remove Directories with mkdir and rmdir
        3. Basic File Searches with find
          1. Use find to Identify a File Based on Type
          2. Use find to Identify a File Based on Size
          3. Use find to Identify a File Based on Time
        4. Different File Archives
          1. File Archives with the cpio Command
          2. Disk Dumps with dd
          3. Compression and Uncompression with gzip and gunzip
          4. Compression and Decompression with bzip2 and bunzip2
          5. Archives and Compression with tar
      4. Chapter Summary
      5. Key Terms
      6. Review Questions
    5. 5. Command Filters and Pipes
      1. Introduction
      2. Text Files as a Stream
        1. Standard Input, Output, and Error Concepts
          1. Standard Output
          2. Standard Input
          3. Standard Error
        2. Data Redirection
          1. Redirection Arrows
          2. A Pipe Redirects Output as Input
          3. Read between Pipes with tee
          4. Apply a Command to a Data Stream with xargs
      3. Text Stream Management
        1. Text File Contents as a Database
          1. Reading with cat
          2. Tops and Bottoms of Files with head and tail
          3. Pagers with more and less
          4. File Statistics with wc
          5. Format the Output with fmt
          6. Substitute Spaces for Tabs with expand
          7. Substitute Tabs for Spaces with unexpand
          8. Add Line Numbers with nl
          9. Process and Translate Characters with tr
        2. Text Utility Filters
          1. Create Data Excerpts with cut
          2. Divide a File with split
          3. Combine Columns with paste or join
          4. Reorder a File with sort
          5. Filter Out Duplicates with uniq
          6. Format for Printing with pr
          7. Convert File Text to Another Format with od
          8. Rework the Text Stream with sed
      4. Search through Text Files
        1. Text Substitution and Regular Expressions
          1. A Review of Regular Expressions
          2. Stream a Substitution with sed
        2. Every Kind of grep
          1. Search through a File with grep
          2. Use Multiple Search Terms with egrep
          3. Search Using Globs with fgrep
      5. Chapter Summary
      6. Key Terms
      7. Review Questions
    6. 6. Processes, Priorities, and Editing
      1. Introduction
      2. The vi Text Editor
        1. Basic Operation
          1. Searches within vi
          2. Navigation through vi
          3. Insert Text Via vi
        2. More vi Commands
          1. The c and d Commands
          2. Yanks, Puts, and the Register
          3. Exit from vi
      3. Priority Management
        1. A List of Running Processes
        2. Processes in top
        3. Making nice and renice
          1. Start a Process with nice
          2. Reprioritize a Process with renice
      4. Process Management
        1. Current Processes and System Status
          1. uptime
          2. free
          3. top
          4. ps
        2. Foreground and Background Processes
          1. The Ampersand (&)
          2. The jobs Command
          3. The bg and fg Commands for Background and Foreground Jobs
          4. No Stop with nohup
        3. Kill a Process
          1. Kill a Process from the top Task Browser
          2. The kill Command
          3. The killall Command
      5. Chapter Summary
      6. Key Terms
      7. Review Questions
    7. 7. Manage and Maintain Filesystems
      1. Introduction
      2. Create and Configure a Partition
        1. Configure Partitions with fdisk
          1. Find Configured Partitions
          2. Explore a Hard Disk with fdisk
          3. Create a New Regular Partition
          4. Create a Non-Linux Partition
          5. Create a Linux Partition for Swap Space
        2. Format the Filesystem
      3. Manage Filesystem Integrity
        1. Monitor a Partition
          1. Capacity Reports with df
          2. Directory Space Reports with du
        2. Putting the fsck on a Partition
        3. Filesystem Maintenance and Repair
          1. Dumping Filesystem Information with dumpe2fs
          2. Debugging Filesystems with debugfs
          3. Tuning Parameters with tune2fs
          4. Maintenance Commands for Other Filesystems
      4. Mount and Unmount a Filesystem
        1. The /etc/fstab Configuration File
        2. Modify /etc/fstab
        3. Users and Mounting External Media
        4. mount Commands
      5. Chapter Summary
      6. Key Terms
      7. Review Questions
    8. 8. File Permissions and More
      1. Introduction
      2. Quota Configuration
        1. Configure a Filesystem for Quotas
        2. User Quotas
        3. Group Quotas
        4. Quota Reports
      3. Manage File Permissions and Ownership
        1. Basic File Permissions
        2. File Permission Numeric Values
        3. User Access Modes and More
          1. The SUID Bit
          2. The SGID Bit
          3. The Sticky Bit
        4. Default Files and the umask
        5. Changing Permissions
        6. Basic File Ownership
          1. Change User Ownership with chown
          2. Change Group Ownership with chgrp or chown
      4. Create and Change Hard and Symbolic Links
        1. Hard Links
        2. Soft Links
      5. Find and Manage System Files
        1. The Filesystem Hierarchy Standard
        2. File Location Databases and Commands
          1. The find Command
          2. The Updateable File Database
        3. Command Location Files
          1. Identify the Path and Alias with which and type
          2. Locate More on a Command with whereis
      6. Chapter Summary
      7. Key Terms
      8. Review Questions
  6. II. LPI Exam 102
    1. 9. Shells, Scripting, and Data Management
      1. Introduction
      2. Manage the Shell Environment
        1. Shell Shortcuts
          1. Add a Directory to the PATH
          2. New Environment Variables
          3. Create and Configure an Alias
          4. Create and Configure a Function
        2. Profiles in bash
          1. /etc/profile, /etc/profile.d/, and ~/.profile
          2. /etc/bashrc, /etc/bash.bashrc, and ~/.bashrc
          3. Other User-Specific bash Configuration Files
        3. Skeleton and User Files
        4. Environment Variables and Aliases
      3. Write Simple Shell Scripts
        1. Review and Customize Existing Scripts
        2. Command Constructs
          1. A for Command
          2. An if Conditional with a for Command
          3. Test Operators
          4. The test Command
          5. A while Loop
          6. The read Gets Input
          7. A seq Command
          8. Command Substitution
      4. Use Basic SQL Commands
        1. Elementary SQL Concepts
        2. The SQL INSERT Command
        3. The SQL DELETE Command
        4. The SQL UPDATE Command
        5. SQL SELECT and Subselect Searches
        6. SQL SELECT Database ORDER BY
        7. SQL SELECT Database GROUP BY
        8. SQL Join Queries
      5. Chapter Summary
      6. Key Terms
      7. Review Questions
    2. 10. The GUI Desktop Environment
      1. Introduction
      2. Basic Linux GUI Configuration
        1. Verify Support
        2. Available Configuration Tools
        3. The xorg.conf Configuration File
        4. The X Font Server
        5. Test the X Server
          1. Display Server Capabilities with xdpyinfo
          2. Display Window Information with xwininfo
        6. Multiple Local GUIs
        7. Local Servers and Remote Clients
      3. Display Manager Options
        1. Activate (or Deactivate) the Display Manager
        2. The GDM Display Manager
          1. Change the Display Manager Greeting
          2. Change the Default Color for the Display Manager
          3. Configure Display Managers for Use by X-Stations
        3. The KDM Display Manager
          1. Change the Display Manager Greeting
          2. Change the Default Color for the Display Manager
          3. Configure Display Managers for Use by X-Stations
        4. The XDM Display Manager
          1. Change the Display Manager Greeting
          2. Change the Default Color for the Display Manager
          3. Configure Display Managers for Use by X-Stations
      4. Accessibility Options
        1. Keyboards
        2. Text Readers
        3. More Provisions for Sight-Impaired Users
      5. Chapter Summary
      6. Key Terms
      7. Review Questions
    3. 11. Administrative Tasks
      1. Introduction
      2. Local Users and Groups
        1. The Shadow Password Suite
        2. /etc/passwd and Users
        3. /etc/group and Groups
        4. /etc/shadow and Users
        5. /etc/gshadow and Groups
        6. Add and Delete Users
          1. Add a User with useradd
          2. Delete a User with userdel
          3. Modify a Current Account with usermod
          4. Assign a Password
          5. An Example New User
        7. Add, Delete, and Modify Groups
        8. Manage Account Information
          1. Suspend and Restore a User Account with usermod
          2. Change Password Aging Information with chage
      3. Job Schedulers
        1. The cron Daemon
          1. Regular cron Jobs
          2. User cron Jobs
          3. The anacron Service
        2. The at Daemon
        3. Denying and Allowing
      4. Localization and Initialization
        1. Current Locale
        2. Configure a Different Language
        3. Time Zone Management
      5. Chapter Summary
      6. Key Terms
      7. Review Questions
    4. 12. Essential System Services
      1. Introduction
      2. Clock Management
        1. The Hardware Clock
          1. Hardware Clock Configuration Files
          2. Configuration Commands
        2. A Local NTP Client
        3. Configure an NTP Server
      3. System Logs
        1. Local Log Files
        2. System Log Configuration
        3. The logger Command
      4. Clients and Mail Transfer Agents
        1. Common Mail Services
          1. The qmail MTA
          2. The Exim MTA
          3. The Postfix MTA
          4. The sendmail MTA
        2. Aliases and E-Mail Forwarding
        3. E-Mail Management
      5. Basic Print Job Management
        1. Basic CUPS Configuration
        2. Other CUPS Configuration Files
        3. Print Queues
          1. The Line Print Query Command (lpq)
          2. The Line Print Job Removal Command (lprm)
          3. The Line Print Move Command (lpmove)
        4. Printer Activation
        5. CUPS and Queue Management
        6. Other LPD Commands
      6. Chapter Summary
      7. Key Terms
      8. Review Questions
    5. 13. Basic Networking
      1. Introduction
      2. Fundamentals of Internet Protocols
        1. Common TCP/IP Ports
        2. IPv4 Addressing
          1. Basic IPv4 Addressing
          2. IPv4 Address Classes
          3. IPv4 Address Exceptions
        3. Private IPv4 Networks
        4. Network Masks and CIDR Notation
        5. Network Addresses and Broadcast IPs
        6. Put It All Together
        7. IPv6 Addressing
        8. Basic Network Commands
          1. Connect with ftp
          2. Remote Logins with telnet
          3. Look Up Address Information with host
          4. Look Up Address Information with dig
          5. Test a Connection with ping
          6. Trace a Network Route with traceroute
          7. Trace a Network Route with tracepath
      3. Basic Network Configuration
        1. Network Configuration Files
          1. The Local Host in /etc/hostname
          2. A Database in /etc/hosts
          3. Other Network Configuration Files
        2. Routing Tables
        3. Network Management Commands
          1. ifconfig
          2. ifdown
          3. ifup
          4. route
          5. ping
      4. Chapter Summary
      5. Key Terms
      6. Review Questions
    6. 14. More Network Fundamentals
      1. Introduction
      2. Basic Network Troubleshooting
        1. Actions on Network Interfaces
          1. Add a Network Interface
          2. Delete a Network Interface
          3. Start a Network Interface
          4. Stop a Network Interface
          5. Restart a Network Interface
          6. Manually Configure a Network Interface
          7. Manually Configure a Network Interface
        2. Troubleshoot Networking
        3. Analyze the Routing Table
        4. Trace a Network Route
        5. Change Network Routes
        6. Local Network Troubleshooting
        7. Open Ports and netstat
      3. A DNS Client
        1. DNS Client Configuration
        2. Host Resolution Files
        3. Name Service Switch Order
        4. The host and dig Commands
      4. Chapter Summary
      5. Key Terms
      6. Review Questions
    7. 15. Security Administration
      1. Introduction
      2. Various Administrative Tasks
        1. Limits with su
        2. Limits with sudoers
        3. The sudo Command
        4. Password Security
          1. The passwd Command
          2. The usermod Command
          3. The chage Command
        5. Open Ports
          1. Review Open Ports and Established Connections with netstat
          2. Port Scanning and nmap
          3. List Open Files and Ports with lsof
        6. Resource Limits
          1. Resource Limits with ulimit
          2. Resource Limits in /etc/security/limits.conf
        7. File Audits
      3. Basic Host Security
        1. Basic Service Security
        2. Users and Passwords
        3. Regulation with TCP Wrappers
          1. Services Regulated by TCP Wrappers
          2. Configuration Files for TCP Wrappers
          3. Directives in TCP Wrappers Configuration Files
        4. The Super Servers
          1. The Original Super Server
          2. The Extended Internet Super Server
      4. Encryption Management
        1. A Secure Shell Server
        2. Secure Shell Connections
        3. Authorized Login Keys and Passphrases
        4. The Authentication Agent
        5. GPG Keys
      5. Chapter Summary
      6. Key Terms
      7. Review Questions
  7. III. Appendixes
    1. A. Chapter Review Question Answers
      1. Chapter 1
      2. Chapter 2
      3. Chapter 3
      4. Chapter 4
      5. Chapter 5
      6. Chapter 6
      7. Chapter 7
      8. Chapter 8
      9. Chapter 9
      10. Chapter 10
      11. Chapter 11
      12. Chapter 12
      13. Chapter 13
      14. Chapter 14
      15. Chapter 15
    2. B. LPIC-1 101, Sample Exam 1
    3. C. LPIC-1 101, Sample Exam 2
    4. D. LPIC-1 101, Sample Exam 1 and 2 Answers
      1. Exam 101: Answers from Appendix B, “LPIC-1 101, Sample Exam 1”
      2. Exam 101: Answers from Appendix C, “LPIC-1 101, Sample Exam 2”
    5. E. LPIC-1 102, Sample Exam 1
    6. F. LPIC-1 102, Sample Exam 2
    7. G. LPIC-1 102, Sample Exam 1 and 2 Answers
      1. Exam 102: Answers from Appendix E, “LPIC-1 102, Sample Exam 1”
      2. Exam 102: Answers from Appendix F, “LPIC-1 102, Sample Exam 2”
    8. H. About the CD
      1. The CD Media
      2. Install and Configure MPlayer
      3. Playing the CBT Nuggets Videos