You are previewing A Practical Guide to Ubuntu Linux®, Fourth Edition.
O'Reilly logo
A Practical Guide to Ubuntu Linux®, Fourth Edition

Book Description

The Most Complete, Easy-to-Follow Guide to Ubuntu Linux  

“As an in-depth guide to Ubuntu, this book does an exceptional job of covering everything from using the Unity desktop to exploring key server configurations.” –Elizabeth K. Joseph, Systems Administrator & Ubuntu Community Member 

  • The #1 Ubuntu resource, fully updated for Ubuntu 14.04 (Trusty Tahr)–the Long Term Support (LTS) release Canonical will support into 2019

  • Extensive new coverage of installation, security, virtualization, MariaDB, Python Programming, and much more

  • Updated JumpStarts help you set up many complex servers in minutes

  • Hundreds of up-to-date examples, plus four updated indexes deliver fast access to reliable answers 

  • Mark Sobell’s A Practical Guide to Ubuntu Linux®, Fourth Edition, is the most thorough and up-to-date reference to installing, configuring, securing, and working with Ubuntu desktops and servers.

    This edition has been fully updated for Ubuntu 14.04 (Trusty Tahr), a milestone LTS (Long Term Support) release, which Canonical will support on both desktops and servers into 2019.

    Sobell walks you through every essential feature and technique, from installing Ubuntu to working with the latest Ubuntu Unity desktop, and from configuring servers and monitoring networks to handling day-to-day system administration. His exceptionally clear explanations demystify everything from Apache, Samba, and postfix, to ufw, virtualization, and MariaDB/MySQL database management. PLUS a new chapter on programming in Python, today’s most popular system automation tool!

    Fully updated JumpStart sections quickly help you get complex servers running–often in minutes. You’ll also find up-to-date guidance on new LPI and CompTIA Linux certification pathways for Linux professionals.

    Sobell draws on his immense Linux knowledge to explain both the “hows” and the “whys” of Ubuntu. He’s taught hundreds of thousands of readers and never forgets what it’s like to be new to Linux. Whether you’re a user, administrator, or programmer, you’ll find everything you need here–now, and for years to come.

    The world’s most practical Ubuntu Linux book is now even more useful!

    This book delivers

  • Completely revamped installation coverage reflecting Ubuntu 14.04’s improved ubiquity (graphical) and debian-installer (textual) installers

  • Updated JumpStarts for quickly setting up Samba, Apache, postfix, FTP, NFS, CUPS, OpenSSH, DNS, and other complex servers

  • Revamped and updated explanations of the ufw, gufw, and iptables firewall tools

  • An all-new chapter on creating VMs (virtual machines) locally and in the cloud

  • New coverage of the MariaDB open source plug-in replacement for MySQL

  • Comprehensive networking coverage, including DNS/BIND, NFS, NIS, FTP, LDAP, and Cacti network monitoring

  • Expert coverage of Internet server configuration and customization, including apache2 (Web) and postfix (mail)

  • A new chapter covering state-of-the-art security techniques, including sudo, cryptography, hash functions, SSL certificates, plus a section on using GPG (GNU Privacy Guard) to protect documents in transit

  • Deep coverage of essential administration tasks–from managing users to CUPS printing, and from configuring LANs and LDAP to building VMs (virtual machines)

  • Complete instructions on keeping systems up to date using apt-get, dpkg, and other tools

  • And much more . . . including a revised 500+ term glossary and four indexes

  • Table of Contents

    1. About This eBook
    2. Title Page
    3. Copyright Page
    4. Praise for Books by Mark G. Sobell
    5. Dedication Page
    6. Brief Contents
    7. JumpStarts
      1. APT (Software Packages)
      2. CUPS (Printing)
      3. OpenSSH (Secure Communication)
      4. FTP (Download and Upload Files)
      5. Email
      6. NFS (Network Filesystem)
      7. Samba (Linux/Windows File Sharing)
      8. DNS (Domain Name Service)
      9. Apache (HTTP)
    8. Contents
    9. Preface
      1. This Book Includes an Ubuntu 14.04 (Trusty Tahr) DVD
        1. For Readers of Digital Editions
      2. Features of This Book
      3. Key Topics Covered in This Book
        1. Details
      4. Supplements
      5. Thanks
    10. 1. Welcome to Linux
      1. Objectives
      2. The History of UNIX and GNU–Linux
        1. The Heritage of Linux: UNIX
        2. Fade to 1983
        3. Next Scene, 1991
        4. The Code Is Free
        5. Linux Is More Than a Kernel
        6. Open-Source Software and Licensing
        7. What Is So Good About Linux?
      3. 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
        6. X Window System
        7. GUIs: Graphical User Interfaces
        8. A Large Collection of Useful Utilities
        9. Interprocess Communication
        10. (Inter)Networking Utilities
        11. System Administration
        12. Software Development
      4. Choosing an Operating System
      5. Chapter Summary
      6. Exercises
    11. Part I: Installing Ubuntu Linux
      1. 2. Installation Overview
        1. Objectives
        2. Conventions Used in This Book
          1. LPI and CompTIA Certification Icons
        3. More Information
        4. Planning the Installation
          1. Considerations
          2. Requirements
          3. Processor Architecture
          4. Interfaces: Installer and Installed System
          5. Gathering Information About the System
        5. Ubuntu Releases, Editions, and Derivatives
          1. Ubuntu Releases
          2. Ubuntu Standard Editions: Desktop and Server Images
          3. Ubuntu Derivatives
        6. Setting Up the Hard Disk
          1. Primary, Extended, and Logical Partitions
          2. The Linux Directory Hierarchy
          3. Mount Points
          4. Partitioning a Disk
          5. RAID
          6. LVM: Logical Volume Manager
        7. Downloading an Image File and Burning/Writing the Installation Medium
          1. The Easy Way to Download an Installation Image File
          2. Other Ways to Download an Installation Image File
          3. Verifying an Installation Image File
          4. Burning a DVD
          5. Writing to a USB Flash Drive
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
      2. 3. Step-by-Step Installation
        1. Objectives
        2. Booting Ubuntu and Running a Live Session
          1. Automatic Boot Sequence
          2. Displaying the Boot Menu
          3. Running a Live Session
        3. Basic Installation
          1. Installing from a Live Session
          2. Installing from the Desktop Boot Menu
          3. The ubiquity Graphical Installer
          4. The ubiquity Advanced Partitioning Screen
          5. Initializing Databases and Updating the System
        4. Advanced Installation
          1. The Boot Menus
          2. Modifying Boot Parameters (Options)
          3. Rescue Mode: Rescuing a Broken System
          4. debian-installer: The Ubuntu Textual Installer
          5. gnome-disks: The GNOME Disk Utility
          6. Setting Up a Dual-Boot System
        5. Chapter Summary
        6. Exercises
        7. Advanced Exercises
    12. Part II: Using Ubuntu Linux
      1. 4. Introduction to Ubuntu
        1. Objectives
        2. Curbing Your Power: root Privileges/sudo
        3. Logging In on the System
          1. The Unity Desktop
          2. Installing the GNOME Flashback Desktop
        4. Working with the Unity Desktop
          1. Terminology
          2. The Dash and the Run a Command Window
          3. Context Menus
          4. Windows
          5. Cutting and Pasting Objects Using the Clipboard
          6. Logging Out
        5. Using the Nautilus File Manager
          1. The Nautilus File Browser Window
          2. The Sidebar
          3. Opening Files
          4. Selecting Objects
          5. The Object Properties Window
        6. The System Settings Window
          1. Desktop Appearance
          2. Displays
          3. Mouse & Touchpad
          4. Time & Date
          5. User Accounts: Changing Your Account Type and Password (GUI)
        7. Getting Help
          1. The Ubuntu Desktop Guide
          2. Using the Internet to Get Help
        8. Installing, Removing, and Updating Software Packages
          1. Software & Updates Window
          2. Updating Software
          3. Adding and Removing Software
          4. Installing Other Desktop Environments
        9. Working from the Command Line
          1. Running Commands from the Command Line
          2. The Shell
          3. Running Basic Command-Line Utilities
          4. Writing and Executing a Basic Shell Script
          5. Getting Help from the Command Line
        10. More About Logging In and Passwords
          1. What to Do If You Cannot Log In
          2. Password Security
          3. passwd: Changing Your Password (CLI)
        11. Chapter Summary
        12. Exercises
        13. Advanced Exercises
      2. 5. The Shell
        1. Objectives
        2. Special Characters
        3. Ordinary Files and Directory Files
          1. The Working Directory
          2. Your Home Directory
        4. The Command Line
          1. A Simple Command
          2. Syntax
          3. Simple Commands
          4. Processing the Command Line
          5. Executing a Command
          6. Editing the Command Line
        5. Standard Input and Standard Output
          1. The Screen as a File
          2. The Keyboard and Screen as Standard Input and Standard Output
          3. Redirection
          4. Pipelines
          5. Lists
        6. Running a Command in the Background
          1. Moving a Job from the Foreground to the Background
          2. kill: Aborting a Background Job
        7. Filename Generation/Pathname Expansion
          1. The ? Special Character
          2. The * Special Character
          3. The [ ] Special Characters
        8. Builtins
        9. Chapter Summary
          1. Utilities and Builtins Introduced in This Chapter
        10. Exercises
        11. Advanced Exercises
      3. 6. The Linux Filesystem
        1. Objectives
        2. The Hierarchical Filesystem
        3. Ordinary Files and Directory Files
          1. Filenames
        4. Pathnames
          1. Absolute Pathnames
          2. Relative Pathnames
        5. Working with Directories
          1. mkdir: Creates a Directory
          2. cd: Changes to Another Working Directory
          3. rmdir: Deletes a Directory
          4. Using Pathnames
          5. mv, cp: Move or Copy Files
          6. mv: Moves a Directory
          7. Important Standard Directories and Files
        6. Access Permissions
          1. ls –l: Displays Permissions
          2. chmod: Changes File Access Permissions
          3. chown: Changes File Ownership
          4. chgrp: Changes File Group Association
          5. Setuid and Setgid Permissions
          6. Directory Access Permissions
        7. ACLs: Access Control Lists
          1. Enabling ACLs
          2. Working with Access Rules
          3. Setting Default Rules for a Directory
        8. Links
          1. Hard Links
          2. Symbolic Links
          3. rm: Removes a Link
        9. Chapter Summary
        10. Exercises
        11. Advanced Exercises
      4. 7. The Linux Utilities
        1. Objectives
        2. Basic Utilities
          1. cat: Joins and Displays Files
          2. date: Displays the System Time and Date
          3. echo: Displays Arguments
          4. hostname: Displays the System Name
          5. less Is more: Display a Text File One Screen at a Time
          6. ls: Displays Information About Files
          7. rm: Removes a File (Deletes a Link)
        3. Working with Files
          1. cp: Copies Files
          2. cut: Selects Characters or Fields from Input Lines
          3. diff: Displays the Differences Between Two Text Files
          4. file: Displays the Classification of a File
          5. find: Finds Files Based on Criteria
          6. grep: Searches for a Pattern in Files
          7. head: Displays the Beginning of a File
          8. lpr: Sends Files to Printers
          9. mv: Renames or Moves a File
          10. sort: Sorts and/or Merges Files
          11. tail: Displays the Last Part of a File
          12. touch: Changes File Modification and Access Times
          13. wc: Displays the Number of Lines, Words, and Bytes in Files
        4. Compressing and Archiving Files
          1. xz, bzip2, and gzip: Compress and Decompress Files
          2. tar: Stores or Extracts Files to/from an Archive File
        5. Displaying User and System Information
          1. free: Displays Memory Usage Information
          2. uptime: Displays System Load and Duration Information
          3. w: Lists Users on the System
          4. who: Lists Users on the System
        6. Miscellaneous Utilities
          1. which and whereis: Locate a Utility
          2. locate: Searches for a File
          3. script: Records a Shell Session
          4. tr: Replaces Specified Characters
          5. unix2dos: Converts Linux Files to Windows and Macintosh Format
          6. xargs: Converts Standard Input to Command Lines
        7. Editing Files
          1. Tutorial: Using vim to Create and Edit a File
          2. Tutorial: Using nano to Create and Edit a File
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
      5. 8. Networking and the Internet
        1. Objectives
        2. Introduction to Networking
        3. Types of Networks and How They Work
          1. Broadcast Networks
          2. Point-to-Point Networks
          3. Switched Networks
          4. LAN: Local Area Network
          5. WAN: Wide Area Network
          6. Internetworking Through Gateways and Routers
          7. Network Protocols
          8. IPv4
          9. IPv6
          10. Host Address
          11. CIDR: Classless Inter-Domain Routing
          12. Hostnames
        4. Communicate over a Network
          1. Mailing List Servers
        5. 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: Query Internet Nameservers
          8. whois: Looks Up Information About an Internet Site
        6. Distributed Computing
          1. The Client/Server Model
          2. DNS: Domain Name Service
          3. Ports
          4. NIS: Network Information Service
          5. NFS: Network Filesystem
          6. Network Services
          7. Common Daemons
          8. Proxy Servers
          9. RPC Network Services
        7. WWW: World Wide Web
          1. Browsers
          2. Search Engines
          3. URL: Uniform Resource Locator
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
    13. Part III: System Administration
      1. 9. The Bourne Again Shell (bash)
        1. Objectives
        2. Background
        3. Startup Files
          1. Login Shells
          2. Interactive Nonlogin Shells
          3. Noninteractive Shells
          4. Setting Up Startup Files
          5. . (Dot) or source: Runs a Startup File in the Current Shell
        4. Commands That Are Symbols
        5. Redirecting Standard Error
        6. Writing and Executing a Shell Script
          1. chmod: Makes a File Executable
          2. #! Specifies a Shell
          3. # Begins a Comment
          4. Executing a Shell Script
        7. Control Operators: Separate and Group Commands
          1. ; and NEWLINE Separate Commands
          2. | and & Separate Commands and Do Something Else
          3. && and || Boolean Control Operators
          4. ( ) Groups Commands
          5. \ Continues a Command
        8. Job Control
          1. jobs: Lists Jobs
          2. fg: Brings a Job to the Foreground
          3. Suspending a Job
          4. bg: Sends a Job to the Background
        9. 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
        10. Parameters and Variables
          1. User-Created Variables
          2. Variable Attributes
          3. Keyword Variables
        11. Special Characters
        12. Locale
          1. LC_: Locale Variables
          2. locale: Displays Locale Information
        13. Time
        14. Processes
          1. Process Structure
          2. Process Identification
          3. Executing a Command
        15. History
          1. Variables That Control History
          2. Reexecuting and Editing Commands
          3. The Readline Library
        16. Aliases
          1. Single Versus Double Quotation Marks in Aliases
          2. Examples of Aliases
        17. Functions
        18. Controlling bash: Features and Options
          1. bash Command-Line Options
          2. Shell Features
        19. Processing the Command Line
          1. History Expansion
          2. Alias Substitution
          3. Parsing and Scanning the Command Line
          4. Command-Line Expansion
        20. Chapter Summary
        21. Exercises
        22. Advanced Exercises
      2. 10. System Administration: Core Concepts
        1. Objectives
        2. The Upstart Event-Based init Daemon
          1. Software Package
          2. Terminology
          3. Jobs
          4. Specifying Events with Arguments
          5. SysVinit (rc) Scripts: Start and Stop System Services
        3. System Operation
          1. Runlevels
          2. Booting the System
          3. Going to Graphical Multiuser Mode
          4. Logging In
          5. Logging Out
          6. Bringing the System Down
          7. Crash
          8. Using Loadable Kernel Modules
        4. GRUB: The Linux Boot Loader
          1. Terminology
          2. Configuring GRUB
          3. grub-mkconfig: Generates the grub.cfg File
          4. grub-install: Installs the MBR and GRUB Files
        5. Recovery (Single-User) Mode
          1. Booting the System to Recovery (Single-User) Mode
        6. Textual System Administration Utilities
        7. Setting Up a Server
          1. Standard Rules in Configuration Files
          2. rpcinfo: Displays Information About rpcbind
        8. DHCP: Configures Network Interfaces
          1. How DHCP Works
          2. DHCP Client
          3. DHCP Server
        9. nsswitch.conf: Which Service to Look at First
          1. Information
          2. Methods
          3. Search Order
          4. Action Items
          5. compat Method: ± in passwd, group, and shadow Files
        10. X Window System
          1. Starting X from a Character-Based Display
          2. Remote Computing and Local Displays
          3. Stopping the X Server
          4. Remapping Mouse Buttons (CLI)
        11. Getting Help
        12. Chapter Summary
        13. Exercises
        14. Advanced Exercises
      3. 11. Files, Directories, and Filesystems
        1. Objectives
        2. Important Files and Directories
        3. File Types
          1. Ordinary Files, Directories, Links, and Inodes
          2. Device Special Files
        4. Filesystems
          1. mount: Mounts a Filesystem
          2. umount: Unmounts a Filesystem
          3. du: Displays Disk Usage Information
          4. fstab: Keeps Track of Filesystems
          5. fsck: Checks Filesystem Integrity
          6. tune2fs: Changes Filesystem Parameters
        5. The XFS Filesystem
        6. Chapter Summary
        7. Exercises
        8. Advanced Exercises
      4. 12. Finding, Downloading, and Installing Software
        1. Objectives
        2. Introduction
        3. JumpStart: Installing and Removing Software Packages Using apt-get
        4. Finding the Package That Holds an Application or File You Need
        5. APT: Keeps the System Up to Date
          1. Repositories
          2. sources.list: Specifies Repositories for APT to Search
          3. The APT Local Package Indexes and the APT Cache
          4. The apt cron Script and APT Configuration Files
          5. apt-get: Works with Packages and the Local Package Index
          6. apt-cache: Displays Package Information
          7. apt-get source: Downloads Source Files
        6. dpkg: The Debian Package Management System
          1. deb Files
          2. dpkg: The Foundation of the Debian Package Management System
        7. BitTorrent
          1. Prerequisites
          2. transmission-cli: Downloading a BitTorrent File
        8. Installing Non-dpkg Software
          1. The /opt and /usr/local Directories
          2. GNU Configure and Build System
        9. Keeping Software Up to Date
          1. Bugs
        10. curl: Downloads Files Noninteractively
        11. Chapter Summary
        12. Exercises
        13. Advanced Exercises
      5. 13. Printing with CUPS
        1. Objectives
        2. Introduction
          1. Prerequisites
          2. More Information
          3. Notes
        3. The System Configures a Local Printer Automatically
        4. JumpStart I: Configuring a Printer Using system-config-printer
          1. Configuration Tabs
        5. JumpStart II: Setting Up a Local or Remote Printer
        6. Working with the CUPS Web Interface
        7. Configuring Printers
          1. Modifying a Printer
          2. Using the CUPS Web Interface
          3. CUPS on the Command Line
          4. Sharing CUPS Printers
        8. Traditional UNIX Printing
        9. Printing from Windows
          1. Printing Using CUPS
          2. Printing Using Samba
        10. Printing to Windows
        11. Chapter Summary
        12. Exercises
        13. Advanced Exercises
      6. 14. Administration Tasks
        1. Objectives
        2. Configuring User and Group Accounts
          1. unity-control-center: Manages User Accounts
          2. Managing User Accounts from the Command Line
        3. Backing Up Files
          1. Choosing a Backup Medium
          2. Backup Utilities
          3. Performing a Simple Backup
        4. Scheduling Tasks
          1. cron and anacron: Schedule Routine Tasks
          2. at: Runs Occasional Tasks
        5. System Reports
          1. vmstat: Reports Virtual Memory Statistics
          2. top: Lists Processes Using the Most Resources
        6. Maintaining the System
          1. timedatectl: Reports on and Sets the System Clock
          2. parted: Reports on and Partitions a Hard Disk
          3. logrotate: Manages Log Files
          4. rsyslogd: Logs System Messages
          5. Solving Problems
        7. Chapter Summary
        8. Exercises
        9. Advanced Exercises
      7. 15. System Security
        1. Objectives
        2. Running Commands with root Privileges
          1. Administrator
          2. The Special Powers of a User Working with root Privileges
          3. Gaining root Privileges
          4. Real UID Versus Effective UID
          5. Using su to Gain root Privileges
          6. Using sudo to Gain root Privileges
          7. Unlocking the root Account (Assigning a Password to root)
          8. Avoiding a Trojan Horse
        3. Passwords
        4. Securing a Server
          1. TCP Wrappers
          2. Setting Up a chroot Jail
        5. PAM
        6. Cryptography
          1. Features
          2. Terminology
          3. Encrypting a Message
          4. Cryptographic Hash Functions
          5. Signing a Message Using a Hash Value
          6. SSL Certificates
        7. GPG (GNU Privacy Guard)
          1. Tutorial: Using GPG to Secure a File
          2. gpg-agent: Holds Your Private Keys
          3. Make Your Communication More Secure
          4. Encrypting and Decrypting a File
          5. Signing and Encrypting a File
          6. Signing a Key on Your Keyring
          7. Using a Keyserver
        8. Security Resources
        9. Chapter Summary
        10. Exercises
        11. Advanced Exercises
      8. 16. Configuring and Monitoring a LAN
        1. Objectives
        2. More Information
        3. Setting Up the Hardware
          1. Connecting the Computers
          2. Routers
          3. NIC: Network Interface Card
          4. Tools
        4. Configuring the Systems
        5. NetworkManager: Configures Network Connections
          1. The NetworkManager Applet Menu
        6. Setting Up Servers
        7. Introduction to Cacti
          1. Configuring SNMP
          2. Setting Up LAMP
          3. Prerequisites
          4. Configuring MySQL
          5. Setting Up Cacti
          6. Configuring Cacti
          7. Basic Cacti Administration
          8. Setting Up a Data Source
        8. Chapter Summary
        9. Exercises
        10. Advanced Exercises
      9. 17. Setting Up Virtual Machines Locally and in the Cloud
        1. Objectives
        2. VMs (Virtual Machines)
          1. Implementations
        3. gnome-boxes
        4. QEMU/KVM
          1. Prerequisites
          2. virt-manager: Installing Ubuntu on QEMU/KVM
          3. virsh: Work with VMs on the Command Line
        5. VMware Player: Installing Ubuntu on VMware
          1. Installing VMware Player on a Linux System
          2. Installing VMware Player on a Windows System
          3. Installing Ubuntu on VMware Player
        6. Cloud Computing
          1. AWS: Setting Up a Virtual System in the Cloud
        7. Chapter Summary
        8. Exercises
        9. Advanced Exercises
    14. Part IV: Using Clients and Setting Up Servers
      1. 18. The OpenSSH Secure Communication Utilities
        1. Objectives
        2. Introduction to OpenSSH
          1. Files
          2. More Information
        3. Running the ssh, scp, and sftp OpenSSH Clients
          1. Prerequisites
          2. JumpStart I: Using ssh and scp to Connect to an OpenSSH Server
          3. Configuring OpenSSH Clients
          4. ssh: Logs in or Executes Commands on a Remote System
          5. scp: Copies Files to and from a Remote System
          6. sftp: A Secure FTP Client
          7. ~/.ssh/config and /etc/ssh/ssh_config Configuration Files
        4. Setting Up an OpenSSH Server (sshd)
          1. Prerequisites
          2. Note
          3. JumpStart II: Starting an OpenSSH Server
          4. Authorized Keys: Automatic Login
          5. Randomart Image
          6. ssh-agent: Holds Your Private Keys
          7. Command-Line Options
          8. /etc/ssh/sshd_config Configuration File
        5. Troubleshooting
        6. Tunneling/Port Forwarding
          1. Forwarding X11
          2. Port Forwarding
        7. Chapter Summary
        8. Exercises
        9. Advanced Exercises
      2. 19. The rsync Secure Copy Utility
        1. Objectives
        2. Syntax
        3. Arguments
        4. Options
          1. Notes
          2. More Information
        5. Examples
          1. Using a Trailing Slash (/) on source-file
          2. Removing Files
          3. Copying Files to and from a Remote System
          4. Mirroring a Directory
          5. Making Backups
          6. Restoring a File
        6. Chapter Summary
        7. Exercises
      3. 20. FTP: Transferring Files Across a Network
        1. Objectives
        2. Introduction to FTP
          1. Security
          2. FTP Connections
          3. FTP Clients
          4. More Information
          5. Notes
        3. Running the ftp and sftp FTP Clients
          1. Prerequisites
          2. JumpStart I: Downloading Files Using ftp
          3. Anonymous FTP
          4. Automatic Login
          5. Binary Versus ASCII Transfer Mode
          6. ftp Specifics
        4. Setting Up an FTP Server (vsftpd)
          1. Prerequisites
          2. Notes
          3. JumpStart II: Starting a vsftpd FTP Server
          4. Troubleshooting
          5. Configuring a vsftpd Server
        5. Chapter Summary
        6. Exercises
        7. Advanced Exercises
      4. 21. postfix: Setting Up Mail Servers, Clients, and More
        1. Objectives
        2. Overview
          1. Mailboxes: mbox Versus maildir Format
          2. Protocols: IMAP and POP3
        3. Introduction to postfix
          1. Outbound Email
          2. Inbound Email
          3. The postfix to sendmail Compatibility Interface
          4. Alternatives to postfix
          5. More Information
        4. Setting Up a postfix Mail Server
          1. Prerequisites
          2. Notes
          3. Testing postfix
          4. postfix Log Files
        5. JumpStart: Configuring postfix to Use Gmail as a Smarthost
        6. Configuring postfix
          1. The /etc/mailname File
          2. The /etc/postfix/main.cf File
          3. postfix Lookup Tables
          4. The /etc/postfix/master.cf File
          5. Aliases and Forwarding
          6. dpkg-reconfigure: Reconfigures postfix
        7. SpamAssassin
          1. How SpamAssassin Works
          2. Prerequisites
          3. Testing SpamAssassin
          4. Configuring SpamAssassin
        8. Additional Email Tools
          1. Webmail
          2. Mailing Lists
        9. dovecot: Setting Up an IMAP or POP3 Mail Server
          1. Prerequisites
          2. Notes
          3. Testing dovecot
        10. Chapter Summary
        11. Exercises
        12. Advanced Exercises
      5. 22. NIS and LDAP
        1. Objectives
        2. Introduction to NIS
          1. How NIS Works
          2. More Information
        3. Running an NIS Client
          1. Prerequisites
          2. Notes
          3. Configuring an NIS Client
          4. Troubleshooting an NIS Client
          5. yppasswd: Changes NIS Passwords
        4. Setting Up an NIS Server
          1. Prerequisites
          2. Notes
          3. Configuring an NIS Server
          4. Troubleshooting an NIS Server
          5. yppasswdd: The NIS Password Update Daemon
        5. Introduction to LDAP
          1. More Information
        6. Setting Up an LDAP Server
          1. Prerequisites
          2. Notes
          3. Test the Server
          4. Modifying and Adding Directory Entries
          5. Using Thunderbird with LDAP
        7. Chapter Summary
        8. Exercises
        9. Advanced Exercises
      6. 23. NFS: Sharing Directory Hierarchies
        1. Objectives
        2. Introduction to NFS
          1. More Information
        3. Running an NFS Client
          1. Prerequisites
          2. JumpStart I: Mounting a Remote Directory Hierarchy
          3. mount: Mounts a Directory Hierarchy
          4. Improving Performance
          5. /etc/fstab: Mounts Directory Hierarchies Automatically
        4. Setting Up an NFS Server
          1. Prerequisites
          2. Notes
          3. JumpStart II: Configuring an NFS Server Using shares-admin
          4. Manually Exporting a Directory Hierarchy
          5. Where the System Keeps NFS Mount Information
          6. exportfs: Maintains the List of Exported Directory Hierarchies
          7. Troubleshooting
        5. automount: Mounts Directory Hierarchies on Demand
        6. Chapter Summary
        7. Exercises
        8. Advanced Exercises
      7. 24. Samba: Linux and Windows File and Printer Sharing
        1. Objectives
        2. Introduction to Samba
          1. More Information
          2. Notes
          3. Samba Users, User Maps, and Passwords
          4. smbpasswd and pdbedit: Work with Samba Users and Passwords
        3. Running Samba Clients
          1. Prerequisites
          2. Working with Shares from Linux
          3. Working with Shares from Windows
        4. Setting Up a Samba Server
          1. Prerequisites
          2. JumpStart: Configuring a Samba Server Using shares-admin
          3. smb.conf: Manually Configuring a Samba Server
        5. Troubleshooting
        6. Chapter Summary
        7. Exercises
        8. Advanced Exercises
      8. 25. DNS/BIND: Tracking Domain Names and Addresses
        1. Objectives
        2. Introduction to DNS
          1. Nodes, Domains, and Subdomains
          2. Zones
          3. Queries
          4. Servers
          5. Resource Records
          6. DNS Queries and Responses
          7. Reverse Name Resolution
          8. How DNS Works
          9. More Information
        3. Setting Up a DNS Server
          1. Prerequisites
          2. Notes
          3. JumpStart: Setting Up a DNS Cache
        4. Configuring a DNS Server
          1. named.conf: The named Configuration File
          2. Zone Files
          3. Setting Up a DNS Cache
          4. DNS Glue Records
          5. TSIGs: Transaction Signatures
          6. Running BIND in a chroot Jail
          7. Troubleshooting
        5. Chapter Summary
        6. Exercises
        7. Advanced Exercises
      9. 26. ufw, gufw, and iptables: Setting Up a Firewall
        1. Objectives
        2. ufw: The Uncomplicated Firewall
        3. gufw: The Graphical Interface to ufw
          1. The Firewall Window
          2. Adding Rules
        4. Introduction to iptables
          1. More Information
          2. Prerequisites
          3. Notes
          4. Anatomy of an iptables Command
        5. Building a Set of Rules Using iptables
          1. Commands
          2. Packet Match Criteria
          3. Display Criteria
          4. Match Extensions
          5. Targets
        6. Copying Rules to and from the Kernel
        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
      10. 27. Apache (apache2): Setting Up a Web Server
        1. Objectives
        2. Introduction
          1. More Information
          2. Notes
        3. Running an Apache Web Server
          1. Prerequisites
          2. JumpStart: Getting Apache Up and Running
          3. Configuring Apache
          4. Filesystem Layout
        4. Configuration Directives
          1. Directives You Might Want to Modify as You Get Started
          2. Contexts and Containers
          3. Advanced Configuration Directives
        5. Advanced Configuration
          1. Redirects
          2. Content Negotiation
          3. Server-Generated Directory Listings (Indexing)
          4. Virtual Hosts
        6. Troubleshooting
        7. Modules
          1. mod_cgi and CGI Scripts
          2. mod_ssl
          3. Authentication Modules and .htaccess Files
          4. Scripting Modules
          5. Multiprocessing Modules (MPMs)
        8. webalizer: Analyzes Web Traffic
        9. Error Codes
        10. Chapter Summary
        11. Exercises
        12. Advanced Exercises
    15. Part V: Programming Tools
      1. 28. Programming the Bourne Again Shell (bash)
        1. Objectives
        2. Control Structures
          1. if...then
          2. if...then...else
          3. if...then...elif
          4. for...in
          5. for
          6. while
          7. until
          8. break and continue
          9. case
          10. select
          11. Here Document
        3. File Descriptors
          1. Opening a File Descriptor
          2. Duplicating a File Descriptor
          3. File Descriptor Examples
          4. Determining Whether a File Descriptor Is Associated with the Terminal
        4. Parameters
          1. Positional Parameters
          2. Special Parameters
        5. Variables
          1. Shell Variables
          2. Environment, Environment Variables, and Inheritance
          3. Expanding Null and Unset Variables
          4. Array Variables
          5. Variables in Functions
        6. Builtin Commands
          1. type: Displays Information About a Command
          2. read: Accepts User Input
          3. exec: Executes a Command or Redirects File Descriptors
          4. trap: Catches a Signal
          5. kill: Aborts a Process
          6. eval: Scans, Evaluates, and Executes a Command Line
          7. getopts: Parses Options
          8. A Partial List of Builtins
        7. Expressions
          1. Arithmetic Evaluation
          2. Logical Evaluation (Conditional Expressions)
          3. String Pattern Matching
          4. Arithmetic Operators
        8. Implicit Command-Line Continuation
        9. Shell Programs
          1. A Recursive Shell Script
          2. The quiz Shell Script
        10. Chapter Summary
        11. Exercises
        12. Advanced Exercises
      2. 29. The Python Programming Language
        1. Objectives
        2. Introduction
          1. Invoking Python
          2. More Information
          3. Writing to Standard Output and Reading from Standard Input
          4. Functions and Methods
        3. Scalar Variables, Lists, and Dictionaries
          1. Scalar Variables
          2. Lists
          3. Dictionaries
        4. Control Structures
          1. if
          2. if...else
          3. if...elif...else
          4. while
          5. for
        5. Reading from and Writing to Files
          1. File Input and Output
          2. Exception Handling
          3. Pickle
        6. Regular Expressions
        7. Defining a Function
        8. Using Libraries
          1. Standard Library
          2. Nonstandard Libraries
          3. SciPy and NumPy Libraries
          4. Namespace
          5. Importing a Module
          6. Example of Importing a Function
        9. Lambda Functions
        10. List Comprehensions
        11. Chapter Summary
        12. Exercises
        13. Advanced Exercises
      3. 30. The MariaDB SQL Database Management System
        1. Objectives
        2. History
        3. Notes
          1. Terminology
          2. Syntax and Conventions
          3. More Information
        4. Installing a MariaDB Server
          1. Client Options
        5. Setting Up MariaDB
          1. Assigning a Password to the MariaDB User Named root
          2. Removing Anonymous Users
          3. Running the Secure Installation Script
          4. ~/.my.cnf: Configures a MariaDB Client
          5. ~/.mysql_history: Stores Your MariaDB History
          6. Creating a Database
          7. Adding a User
        6. Examples
          1. Logging In
          2. Creating a Table
          3. Adding Data
          4. Retrieving Data
          5. Backing Up a Database
          6. Modifying Data
          7. Creating a Second Table
          8. Joins
        7. Chapter Summary
        8. Exercises
        9. Advanced Exercises
    16. Part VI: 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
      2. B. Help
        1. Solving a Problem
        2. Finding Linux-Related Information
          1. Desktop Applications
          2. Programming Languages
          3. Linux Newsgroups
          4. Mailing Lists
        3. Specifying a Terminal
      3. C. Keeping the System Up to Date Using yum
        1. Installing and Removing Software Packages Using yum
        2. Working with yum
          1. Finding the Package That Holds a File You Need
          2. Updating Packages
          3. yum Commands
          4. yum.conf: Configures yum
          5. yum Repositories
      4. D. LPI and CompTIA Certification
        1. More Information
        2. Linux Essentials
          1. Topic 1: The Linux Community and a Career in Open Source
          2. Topic 2: Finding Your Way on a Linux System
          3. Topic 3: The Power of the Command Line
          4. Topic 4: The Linux Operating System
          5. Topic 5: Security and File Permissions
        3. Certification Exam 1 Objectives: LX0-101
          1. 101 System Architecture
          2. 102 Linux Installation and Package Management
          3. 103 GNU and UNIX Commands
          4. 104 Devices, Linux Filesystems, Filesystem Hierarchy Standard
        4. Certification Exam 2 Objectives: LX0-102
          1. 105 Shells, Scripting, and Data Management
          2. 106 User Interfaces and Desktops
          3. 107 Administrative Tasks
          4. 108 Essential System Services
          5. 109 Networking Fundamentals
          6. 110 Security
    17. Glossary
    18. JumpStart Index
    19. File Tree Index
    20. Utility Index
    21. Main Index
    22. DVD-ROM Warranty
    23. Code Snippets