Cover image for LPI Linux Certification in a Nutshell, 3rd Edition

Book description

If you want to be certified by the Linux Professional Institute (LPI), this updated guide will help you prepare thoroughly for the technically challenging Level 1 LPI exams, which test basic knowledge of Linux installation, configuration, and command-line skills. In LPI Linux Certification in a Nutshell, you'll find a summary of the core skills you need, as well as sample exercises, test questions, and hints to help you focus.

Table of Contents

  1. LPI Linux Certification in a Nutshell
  2. Preface
    1. The Linux Professional Institute
    2. Audience for This Book
    3. Organization
      1. Book Chapters
    4. Conventions Used in This Book
    5. Using Code Examples
    6. How to Contact Us
    7. Safari® Books Online
    8. Acknowledgments
  3. 1. LPI Exams
  4. 2. Exam 101 Study Guide
    1. Exam Preparation
  5. 3. System Architecture (Topic 101.1)
    1. Objective 1: Determine and Configure Hardware Settings
      1. BIOS
        1. Date and time
        2. Disks and boot devices
        3. Using the /proc filesystem
      2. USB Topology
      3. USB Controllers
      4. USB Devices
      5. USB Drivers
      6. USB Hotplug
      7. Reporting Your Hardware
        1. lsdev
        2. lspci
      8. Manipulating Modules
        1. lsmod
        2. insmod
        3. rmmod
        4. modinfo
        5. modprobe
      9. Device Management Definitions
  6. 4. Change Runlevels and Shut Down or Reboot System (Topics 101.2 and 101.3)
    1. Objective 2: Boot the System
      1. Boot-time Kernel Parameters
      2. Introduction to Kernel Module Configuration
        1. Kernel boot-time messages
        2. Reviewing system logs
    2. Objective 3: Change Runlevels and Shut Down or Reboot System
      1. Single-User Mode
      2. Overview of the /etc Directory Tree and the init Process
      3. Setting the Default Runlevel
      4. Determining Your System’s Runlevel
        1. Changing runlevels with init and telinit
          1. init
  7. 5. Linux Installation and Package Management (Topic 102)
    1. Objective 1: Design a Hard Disk Layout
      1. System Considerations
        1. Limited disk space
        2. Larger systems
        3. Mount points
        4. Superblock
        5. MBR
        6. Booting from a USB device
        7. System role
        8. Backup
      2. Swap Space
      3. General Guidelines
    2. Objective 2: Install a Boot Manager
      1. LILO
        1. The boot loader
        2. The LILO map installer and its configuration file
          1. lilo
        3. LILO locations
      2. GRUB
        1. GRUB device naming
        2. Installing GRUB
        3. Booting GRUB
        4. The GRUB configuration file
    3. Objective 3: Manage Shared Libraries
      1. Shared Library Dependencies
        1. ldd
      2. Linking Shared Libraries
        1. ldconfig
    4. Objective 4: Use Debian Package Management
      1. Debian Package Management Overview
      2. Managing Debian Packages
        1. dpkg
        2. apt-get
        3. dselect
        4. alien
    5. Objective 5: Use Red Hat Package Manager (RPM)
      1. RPM Overview
      2. Running rpm
        1. rpm
      3. YUM Overview
        1. Checking installed packages
        2. Checking for updates
        3. Installing packages
        4. Removing packages
  8. 6. GNU and Unix Commands (Topic 103)
    1. Objective 1: Work on the Command Line
      1. The Interactive Shell
        1. Shell variable basics
        2. Entering commands at the command prompt
        3. Entering commands not in the PATH
        4. Entering multiple-line commands interactively
        5. Entering command sequences
      2. Command History and Editing
        1. Command substitution
        2. Applying commands recursively through a directory tree
      3. Manpages
        1. man
    2. Objective 2: Process Text Streams Using Filters
      1. cat
      2. cut
      3. expand
      4. fmt
      5. head
      6. join
      7. nl
      8. od
      9. paste
      10. pr
      11. sort
      12. split
      13. tac
      14. tail
      15. tr
      16. unexpand
      17. uniq
      18. wc
    3. Objective 3: Perform Basic File Management
      1. Filesystem Objects
        1. Directories and files
        2. Inodes
        3. File and directory management commands
          1. bzip2
          2. cp
          3. cpio
          4. dd
          5. file
          6. find
          7. gzip and gunzip
          8. mkdir
          9. mv
          10. rm
          11. rmdir
          12. touch
      2. File-Naming Wildcards (File Globbing)
    4. Objective 4: Use Streams, Pipes, and Redirects
      1. Standard I/O and Default File Descriptors
      2. Pipes
      3. Redirection
      4. Using the tee Command
        1. tee
      5. The xargs Command
        1. xargs
    5. Objective 5: Create, Monitor, and Kill Processes
      1. Processes
      2. Process Monitoring
        1. ps
        2. pstree
        3. top
        4. free
        5. uptime
      3. Signaling Active Processes
        1. kill
      4. Terminating Processes
      5. Shell Job Control
        1. bg
        2. fg
        3. jobs
        4. nohup
    6. Objective 6: Modify Process Execution Priorities
      1. nice
        1. nice
        2. renice
    7. Objective 7: Search Text Files Using Regular Expressions
      1. Regular Expression Syntax
      2. Using grep
        1. grep
      3. Using sed
        1. sed
      4. Examples
        1. Anchors
        2. Groups and ranges
        3. Modifiers
        4. Basic regular expression patterns
        5. Using regular expressions as addresses in sed
    8. Objective 8: Perform Basic File Editing Operations Using vi
      1. Invoking vi
      2. vi Basics
  9. 7. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 104)
    1. Objective 1: Create Partitions and Filesystems
      1. Disk Drives Under Linux
        1. Hard disk devices
        2. Disk partitions
        3. The root filesystem and mount points
        4. Managing partitions
          1. fdisk
        5. Creating filesystems
          1. mkfs
        6. Creating swap partitions
          1. mkswap
    2. Objective 2: Maintain the Integrity of Filesystems
      1. Monitoring Free Disk Space and Inodes
        1. df
      2. Monitoring Disk Usage
        1. du
      3. Modifying a Filesystem
        1. tune2fs
        2. xfs_info
      4. Checking and Repairing Filesystems
        1. fsck
        2. xfs_metadump
    3. Objective 3: Control Filesystem Mounting and Unmounting
      1. Managing the Filesystem Table
      2. Mounting Filesystems
        1. mount
      3. Unmounting Filesystems
        1. umount
    4. Objective 4: Set and View Disk Quotas
      1. Quota Limits
      2. Quota Commands
        1. quota
        2. quotaon
        3. quotaoff
        4. quotacheck
        5. edquota
        6. repquota
      3. Enabling Quotas
    5. Objective 5: Manage File Permissions and Ownership
      1. Linux Access Control
        1. The mode bits
        2. The mode string
      2. Setting Access Modes
        1. New files
        2. Changing access modes
          1. chmod
          2. chown
          3. chgrp
      3. Setting Up a Workgroup Directory
    6. Objective 6: Create and Change Hard and Symbolic Links
      1. Why Links?
        1. ln
        2. Preserving links
        3. Finding links to a file
    7. Objective 7: Find System Files and Place Files in the Correct Location
      1. Datatypes
      2. The root Filesystem
        1. The /usr filesystem
        2. The /var filesystem
        3. Linux annex
        4. Where’s that binary?
      3. Locating Files
        1. which
        2. find
        3. locate
        4. updatedb
        5. whereis
        6. type
  10. 8. Exam 101 Review Questions and Exercises
    1. System Architecture (Topic 101)
      1. Review Questions
      2. Exercises
    2. Linux Installation and Package Management (Topic 102)
      1. Review Questions
      2. Exercises
    3. GNU and Unix Commands (Topic 103)
      1. Review Questions
      2. Exercises
    4. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 104)
      1. Review Questions
      2. Exercises
  11. 9. Exam 101 Practice Test
    1. Questions
    2. Answers
  12. 10. Exam 101 Highlighter’s Index
    1. System Architecture
      1. Objective 101.1: Determine and Configure Hardware Settings
        1. PC BIOS
        2. Resource assignments
      2. Objective 101.2: Boot the System
        1. Boot order
        2. Information
      3. Objective 101.3: Change Runlevels and Shut Down or Reboot System
        1. Runlevels
    2. Linux Installation and Package Management
      1. Objective 102.1: Design Hard Disk Layout
        1. /proc
      2. Objective 102.2: Install a Boot Manager
        1. LILO
        2. GRUB
      3. Objective 102.3: Manage Shared Libraries
        1. Concepts
        2. Commands
      4. Objective 102.4: Use Debian Package Management
        1. Commands
      5. Objective 102.5: Use Red Hat Package Manager (RPM)
        1. Concepts
    3. GNU and Unix Commands
      1. Objective 103.1: Work on the Command Line
        1. The interactive shell and shell variables
        2. Entering commands
        3. Command history, editing, and substitution
        4. Recursive execution
      2. Objective 103.2: Process Text Streams Using Filters
        1. The commands
        2. The stream editor, sed
      3. Objective 103.3: Perform Basic File Management
        1. Concepts
        2. File and directory management commands
        3. File-naming wildcards
      4. Objective 103.4: Use Streams, Pipes, and Redirects
        1. Concepts
        2. Standard I/O
        3. Pipes and redirection
      5. Objective 103.5: Create, Monitor, and Kill Processes
        1. Concepts
        2. Monitoring commands
        3. Signaling processes
        4. Shell job control
      6. Objective 103.6: Modify Process Execution Priorities
        1. Concepts
        2. Commands
      7. Objective 103.7: Search Text Files Using Regular Expressions
        1. Concepts
        2. Position anchors
        3. Character sets
        4. Modifiers
        5. Commands
      8. Objective 103.8: Perform Basic File Editing Operations Using vi
        1. Subcommands
    4. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard
      1. Objective 104.1: Create Partitions and Filesystems
        1. Disk drives and partitions
        2. Filesystems
        3. The root filesystem and mount points
        4. Partition and filesystem management commands
      2. Objective 104.2: Maintain the Integrity of Filesystems
        1. Filesystem commands
      3. Objective 104.3: Control Filesystem Mounting and Unmounting
        1. Managing the filesystem table
        2. Mounting and unmounting
        3. Filesystem types
      4. Objective 104.4: Set and View Disk Quotas
        1. Quota types
        2. Commands
      5. Objective 104.5: Manage File Permissions and Ownership
        1. Access control
        2. Setting access modes
        3. Commands for file ownership
      6. Objective 104.6: Create and Change Hard and Symbolic Links
        1. Concepts
        2. ln
      7. Objective 104.7: Find System Files and Place Files in the Correct Location
        1. File Hierarchy Standard (FHS)
        2. The directory hierarchy
        3. Locating files
  13. 11. Exam 102 Overview
  14. 12. Exam 102 Study Guide
    1. Exam Preparation
  15. 13. Shells, Scripting, and Data Management (Topic 105)
    1. Objective 1: Customize and Use the Shell Environment
      1. An Overview of Shells
      2. The Bash Shell
        1. Shells and environment variables
        2. Aliases
        3. Functions
        4. Configuration files
        5. .inputrc
    2. Objective 2: Customize or Write Simple Scripts
      1. Script Files
        1. Creating a simple bash script
        2. Executable files
        3. Shebang!
        4. The shell script’s environment
        5. Location, ownership, and permissions
        6. SUID and SGID rights
      2. Basic Bash Scripts
        1. Return values
        2. File tests
        3. Command substitution
        4. Mailing from scripts
        5. Abbreviated bash command reference
          1. break
          2. case
          3. continue
          4. echo
          5. exit
          6. for
          7. function
          8. getopts
          9. if
          10. kill
          11. read
          12. return
          13. seq
          14. shift
          15. source
          16. test
          17. until
          18. while
    3. Objective 3: SQL Data Management
      1. Accessing a MySQL Server
      2. Database Overview
      3. Aggregate Functions
      4. Multitable Queries
  16. 14. The X Window System (Topic 106)
    1. An Overview of X
    2. Objective 1: Install and Configure X11
      1. Selecting and Configuring an X Server
        1. Supported video hardware
        2. Installing X.Org
        3. Configuring an X server and the xorg.conf file
        4. Distribution-specific tools
      2. X Fonts
        1. Installing fonts
        2. The X font server
      3. Controlling X Applications with .Xresources
    3. Objective 2: Set Up a Display Manager
      1. Configuring xdm
        1. Running xdm manually
        2. Running xdm automatically
        3. Basic xdm customization
      2. X Terminals
        1. xdm for X terminals
      3. Configuring KDM
      4. Configuring GDM
        1. Switching display managers
    4. Objective 3: Accessibility
  17. 15. Administrative Tasks (Topic 107)
    1. Objective 1: Manage User and Group Accounts and Related System Files
      1. User Accounts and the Password File
      2. Groups and the Group File
      3. The Shadow Password and Shadow Group Systems
        1. Group passwords and shadow groups
      4. User and Group Management Commands
        1. useradd
        2. usermod
        3. userdel
        4. groupadd
        5. groupmod
        6. groupdel
        7. passwd
        8. gpasswd
    2. Objective 2: Automate System Administration Tasks by Scheduling Jobs
      1. Using cron
        1. User crontab files
          1. crontab
        2. System crontab files
      2. Using at
        1. at
      3. Controlling User Access to cron and at
    3. Objective 3: Localization and Internationalization
  18. 16. Essential System Services (Topics 108.1 and 108.2)
    1. Objective 1: Maintain System Time
      1. NTP Concepts
      2. The NTP Software Package Components
        1. ntpd
        2. ntpdate
        3. ntpq
        4. ntpdc
        5. ntptrace
      3. The Hardware Clock
        1. hwclock
      4. Time Zones
    2. Objective 2: System Logging
      1. Configuring syslogd
      2. Client/Server Logging
      3. Logfile Rotation
      4. Examining Logfiles
  19. 17. Mail Transfer Agent (MTA) Basics (Topic 108.3)
    1. Objective 3: Mail Transfer Agent (MTA) Basics
      1. Configuration of Sendmail
        1. mail
        2. Mail queuing
      2. Configuration of Postfix
      3. Configuration of Qmail
      4. Configuration of Exim
  20. 18. Manage Printers and Printing (Topic 108.4)
    1. Objective 4: Manage Printers and Printing
    2. An Overview of Printing
      1. BSD and System V Interfaces
      2. LPRng
      3. CUPS
        1. CUPS printing overview
        2. CUPS backends
        3. CUPS filters
        4. Managing CUPS print queues
          1. lp
          2. cancel
          3. lpstat
          4. lpadmin
          5. lpq
          6. lprm
          7. lpr
    3. Troubleshooting General Printing Problems
      1. The Error Logfile
      2. The Page Logfile
      3. The Access Logfile
      4. Using the cups-config Utility for Debugging
  21. 19. Networking Fundamentals (Topic 109.1)
    1. Objective 1: Fundamentals of Internet Protocols
      1. Network Addressing
        1. Private IP addresses and NAT
        2. Classless Inter-Domain Routing (CIDR)
        3. Internet Protocol Version 6 (IPv6)
      2. Masks
      3. Protocols
      4. Services
      5. Utilities
        1. dig
        2. ftp
        3. ping
        4. telnet
        5. traceroute
        6. whois
  22. 20. Basic Network Configuration (Topics 109.2 and 109.4)
    1. Objective 2: Basic Network Configuration and Objective 4: Configuring Client Side DNS
      1. Network Interfaces
        1. Configuration files
        2. Configuration commands
          1. ifconfig
          2. ping
          3. route
      2. DHCP
        1. Subnets and relays
        2. Leases
        3. dhcpd
          1. dhcpd
      3. A Standard Linux Network Configuration
  23. 21. Basic Network Troubleshooting (Topic 109.3)
    1. Objective 3: Basic Network Troubleshooting
      1. ping
      2. host
      3. traceroute
      4. netstat
      1. Common Manual Network Interface Tasks
      2. dig
  24. 22. Security (Topic 110.1)
    1. Objective 1: Perform Security Administration Tasks
      1. The (In)Security of SUID
        1. su
        2. sudo
      2. User IDs and Passwords
        1. usermod
      3. Shadow Passwords
        1. chage
      4. Setting Limits on Users
        1. ulimit
      5. Querying System Services
        1. netstat
        2. nmap
        3. lsof
  25. 23. Set Up Host Security (Topic 110.2)
    1. Objective 2: Set Up Host Security
      1. The Super-Server
        1. inetd syntax
        2. xinetd
      2. Security with TCP_WRAPPERS
        1. Configuration
  26. 24. Securing Data with Encryption (Topic 110.3)
    1. Objective 3: Securing Data With Encryption
    2. Using Secure Shell (SSH)
      1. Installation and Configuration
        1. Example /etc/ssh/sshd_config file
    3. DSA and RSA Overview
      1. Generating and Using Keys
        1. Enabling bulk logins on multiple hosts for multiple users
        2. Using the RSA algorithm
          1. ssh-keygen
      2. The Server Public and Private Key
      3. ssh-agent
      4. Other SSH Tricks
      5. SSH Port Forwarding
        1. ssh -R|L
    4. Configuring OpenSSH
    5. Configuring and Using GNU Privacy Guard (GPG)
      1. Generating a Key Pair
      2. Importing a Public Key to a GPG Keyring
      3. Signing Keys
      4. Listing Keys
      5. Export both a Public and Private Key
      6. Encrypting a File
      7. Troubleshooting Files in the ~/.gnupg/ Directory
  27. 25. Exam 102 Review Questions and Exercises
    1. Shells, Scripting, and Data Management (Topic 105)
      1. Review Questions
      2. Exercises
    2. The X Window System (Topic 106)
      1. Review questions
      2. Exercises
    3. Administrative Tasks (Topic 107)
      1. Review questions
      2. Exercises
    4. Essential System Services (Topic 108)
      1. Review Questions
      2. Exercises
    5. Networking Fundamentals (Topic 109)
      1. Review Questions
      2. Exercises
    6. Security (Topic 110)
      1. Review Questions
      2. Exercises
  28. 26. Exam 102 Practice Test
    1. Questions
    2. Answers
  29. 27. Exam 102 Highlighter’s Index
    1. Shells, Scripting, and Data Management
      1. Objective 105.1: Customize and Use the Shell Environment
        1. Bash
      2. Objective 105.2: Customize or Write Simple Scripts
        1. Environment
      3. Objective 105.3: SQL Data Management
    2. The X Window System
      1. Objective 106.1: Install and Configure X11
      2. Objective 106.2: Set Up a Display Manager
      3. Objective 106.3: Accessibility
    3. Administrative Tasks
      1. Objective 107.1: Manage User and Group Accounts and Related System Files
        1. passwd and group
        2. Shadow files
        3. User and group management commands
      2. Objective 107.2: Automate System Administration Tasks by Scheduling Jobs
        1. Using cron
        2. Using at
        3. User access
      3. Objective 107.3: Localization and Internationalization
    4. Essential System Services
      1. Objective 108.1: Maintain System Time
      2. Objective 108.2: System Logging
        1. Syslog
        2. Logfile rotation
        3. Examining logfiles
      3. Objective 108.3: Mail Transfer Agent (MTA) Basics
      4. Objective 108.4: Manage Printers and Printing
        1. CUPS
        2. Legacy printing (lpd)
        3. /etc/printcap
    5. Networking Fundamentals
      1. Objective 109.1: Fundamentals of Internet Protocols
        1. Addressing and masks
        2. Protocols
        3. TCP/IP services
        4. TCP/IP utilities
      2. Objective 109.2: Basic Network Configuration
      3. Objective 109.3: Basic Network Troubleshooting
      4. Objective 109.4: Configuring Client Side DNS
    6. Security
      1. Objective 110.1: Perform Security Administration Tasks
      2. Objective 110.2: Set Up Host Security
        1. TCP wrappers
        2. Shadow passwords
      3. Objective 110.3: Securing Data with Encryption
  30. Index
  31. About the Authors
  32. Colophon
  33. Copyright