<p>Introduction xxxi</p> <h2>PART I: GETTING STARTED</h2> <h3>Chapter 1 Installing Ubuntu and Post-Installation Configuration 1</h3> <p>Before You Begin the Installation 1</p> <p>Researching Your Hardware Specifications 2</p> <p>Installation Options 2</p> <p>32-Bit Versus 64-Bit Ubuntu 4</p> <p>Planning Partition Strategies 5</p> <p>The Boot Loader 5</p> <p>Installing from DVD or USB Drive 6</p> <p>Step-by-Step Installation 6</p> <p>Installing 7</p> <p>First Update 11</p> <p>Shutting Down 11</p> <p>Finding Programs and Files 12</p> <p>Software Updater 12</p> <p>The sudo Command 14</p> <p>Configuring Software Repositories 15</p> <p>System Settings 17</p> <p>Detecting and Configuring a Printer 18</p> <p>Configuring Power Management in Ubuntu 18</p> <p>Setting the Time and Date 19</p> <p>Configuring Wireless Networks 20</p> <p>Troubleshooting Post-Installation Configuration Problems 21</p> <h3>Chapter 2 Background Information and Resources 23</h3> <p>What Is Linux? 23</p> <p>Why Use Linux? 25</p> <p>What Is Ubuntu? 27</p> <p>Ubuntu for Business 27</p> <p>Ubuntu in Your Home 28</p> <p>Getting the Most from Linux and Ubuntu Documentation 28</p> <p>Linux 29</p> <p>Ubuntu 30</p> <h2>PART II: DESKTOP UBUNTU</h2> <h3>Chapter 3 Foundations of the Linux GUI 31</h3> <p>Foundations and the X Server 31</p> <p>Basic X Concepts 32</p> <p>Using X 33</p> <p>Elements of the xorg conf File 34</p> <p>Starting X 39</p> <p>Using a Display Manager 39</p> <p>Changing Window Managers 39</p> <h3>Chapter 4 Ubuntu Desktop Options 41</h3> <p>Desktop Environment 41</p> <p>Using GNOME: A Primer 42</p> <p>KDE and Kubuntu 45</p> <p>Xfce and Xubuntu 46</p> <p>LXDE and Lubuntu 47</p> <p>MATE and Ubuntu MATE 48</p> <p>Ubuntu Budgie 49</p> <p>Ubuntu Kylin 50</p> <h3>Chapter 5 On the Internet 51</h3> <p>Getting Started with Firefox 52</p> <p>Checking Out Google Chrome and Chromium 53</p> <h3>Chapter 6 Productivity Applications 55</h3> <p>Introducing LibreOffice 56</p> <p>Other Useful Productivity Software 58</p> <p>Working with PDFs 58</p> <p>Writing Scripts 59</p> <p>Working with XML and DocBook 59</p> <p>Working with LaTeX 60</p> <p>Creating Mind Maps 61</p> <p>Productivity Applications Written for Microsoft Windows 61</p> <h3>Chapter 7 Multimedia Applications 63</h3> <p>Sound and Music 63</p> <p>Sound Cards 64</p> <p>Sound Formats 65</p> <p>Listening to Music 65</p> <p>Graphics Manipulation 66</p> <p>The GNU Image Manipulation Program 66</p> <p>Using Scanners in Ubuntu 67</p> <p>Working with Graphics Formats 67</p> <p>Capturing Screen Images 69</p> <p>Other Graphics Manipulation Options 70</p> <p>Using Digital Cameras with Ubuntu 70</p> <p>Handheld Digital Cameras 70</p> <p>Using Shotwell Photo Manager 71</p> <p>Burning CDs and DVDs in Ubuntu 71</p> <p>Creating CDs and DVDs with Brasero 71</p> <p>Creating CDs from the Command Line 72</p> <p>Creating DVDs from the Command Line 73</p> <p>Viewing Video 75</p> <p>Video Formats 75</p> <p>Viewing Video in Linux 76</p> <p>Recording and Editing Audio 76</p> <p>Editing Video 77</p> <h3>Chapter 8 Games 79</h3> <p>Ubuntu Gaming 79</p> <p>Installing Proprietary Video Drivers 80</p> <p>Online Game Sources 81</p> <p>Steam 81</p> <p>GOG com 82</p> <p>Humble 82</p> <p>itch io 82</p> <p>LGDB 82</p> <p>Game Jolt 82</p> <p>Installing Games from the Ubuntu Repositories 82</p> <p>Warsow 82</p> <p>Scorched 3D 83</p> <p>Frozen Bubble 84</p> <p>SuperTux 84</p> <p>Battle for Wesnoth 85</p> <p>Frets on Fire 85</p> <p>FlightGear 87</p> <p>Speed Dreams 87</p> <p>Games for Kids 88</p> <p>Commercial Games 88</p> <p>Playing Windows Games 88</p> <h2>PART III: SYSTEM ADMINISTRATION</h2> <h3>Chapter 9 Managing Software 91</h3> <p>Ubuntu Software 91</p> <p>Using Synaptic for Software Management 92</p> <p>Staying Up to Date 94</p> <p>Working on the Command Line 95</p> <p>Day-to-Day APT Usage 95</p> <p>Finding Software 98</p> <p>Using apt-get Instead of apt 99</p> <p>Compiling Software from Source 100</p> <p>Compiling from a Tarball 100</p> <p>Compiling from Source from the Ubuntu Repositories 101</p> <p>Configuration Management 102</p> <p>dotdee 102</p> <p>Ubuntu Core 103</p> <p>Using the Snappy Package Manager 103</p> <h3>Chapter 10 Command-Line Beginner's Class 105</h3> <p>What Is the Command Line? 106</p> <p>Accessing the Command Line 107</p> <p>Text-Based Console Login 107</p> <p>Logging Out 108</p> <p>Logging In and Out from a Remote Computer 108</p> <p>User Accounts 109</p> <p>Reading Documentation 111</p> <p>Using Man Pages 111</p> <p>Using apropros 112</p> <p>Using whereis 112</p> <p>Understanding the Linux File System Hierarchy 112</p> <p>Essential Commands in /bin and /sbin 114</p> <p>Configuration Files in /etc 114</p> <p>User Directories: /home 115</p> <p>Using the Contents of the /proc Directory to Interact with or Obtain Information from the Kernel 115</p> <p>Working with Shared Data in the /usr Directory 117</p> <p>Temporary File Storage in the /tmp Directory 117</p> <p>Accessing Variable Data Files in the /var Directory 117</p> <p>Navigating the Linux File System 117</p> <p>Listing the Contents of a Directory with ls 118</p> <p>Changing Directories with cd 120</p> <p>Finding Your Current Directory with pwd 120</p> <p>Working with Permissions 120</p> <p>Assigning Permissions 121</p> <p>Directory Permissions 122</p> <p>Altering File Permissions with chmod 123</p> <p>File Permissions with umask 124</p> <p>File Permissions with chgrp 125</p> <p>Changing File Permissions with chown 125</p> <p>Understanding Set User ID, Set Group ID, and Sticky Bit Permissions 125</p> <p>Setting Permissions with Access Control Lists 127</p> <p>Working with Files 128</p> <p>Creating a File with touch 128</p> <p>Creating a Directory with mkdir 129</p> <p>Deleting a Directory with rmdir 129</p> <p>Deleting a File or Directory with rm 130</p> <p>Moving or Renaming a File with mv 131</p> <p>Copying a File with cp 131</p> <p>Displaying the Contents of a File with cat 132</p> <p>Displaying the Contents of a File with less 132</p> <p>Using Wildcards and Regular Expressions 133</p> <p>Working as Root 133</p> <p>Understanding and Fixing sudo 134</p> <p>Creating Users 136</p> <p>Deleting Users 137</p> <p>Shutting Down the System 137</p> <p>Rebooting the System 138</p> <p>Commonly Used Commands and Programs 139</p> <h3>Chapter 11 Command-Line Master Class, Part 1 141</h3> <p>Why Use the Command Line? 142</p> <p>Using Basic Commands 143</p> <p>Printing the Contents of a File with cat 144</p> <p>Changing Directories with cd 145</p> <p>Changing File Access Permissions with chmod 147</p> <p>Copying Files with cp 147</p> <p>Printing Disk Usage with du 148</p> <p>Using echo 148</p> <p>Finding Files by Searching with find 149</p> <p>Searches for a String in Input with grep 151</p> <p>Paging Through Output with less 152</p> <p>Creating Links Between Files with ln 154</p> <p>Finding Files from an Index with locate 156</p> <p>Listing Files in the Current Directory with ls 156</p> <p>Listing System Information with lsblk, lshw, lsmod, lspci, and neofetch 158</p> <p>Reading Manual Pages with man 159</p> <p>Making Directories with mkdir 160</p> <p>Moving Files with mv 161</p> <p>Renaming Files with rename 161</p> <p>Deleting Files and Directories with rm 161</p> <p>Sorting the Contents of a File with sort 162</p> <p>Printing the Last Lines of a File with tail 163</p> <p>Printing the Location of a Command with which 164</p> <p>Downloading Files with wget 164</p> <h3>Chapter 12 Command-Line Master Class, Part 2 167</h3> <p>Redirecting Output and Input 167</p> <p>stdin, stdout, stderr, and Redirection 169</p> <p>Comparing Files 170</p> <p>Finding Differences in Files with diff 170</p> <p>Finding Similarities in Files with comm 170</p> <p>Limiting Resource Use and Job Control 171</p> <p>Listing Processes with ps 171</p> <p>Listing Jobs with jobs 173</p> <p>Running One or More Tasks in the Background 173</p> <p>Moving Jobs to the Background or Foreground with bg and fg 174</p> <p>Printing Resource Usage with top 175</p> <p>Setting Process Priority with nice 177</p> <p>Combining Commands 178</p> <p>Pipes 178</p> <p>Combining Commands with Boolean Operators 180</p> <p>Running Separate Commands in Sequence 180</p> <p>Process Substitution 181</p> <p>Executing Jobs in Parallel 181</p> <p>Using Environment Variables 182</p> <p>Using Common Text Editors 185</p> <p>Working with nano 186</p> <p>Working with vi 187</p> <p>Working with emacs 188</p> <p>Working with sed and awk 189</p> <p>Working with Compressed Files 191</p> <p>Using Multiple Terminals with byobu192</p> <p>Doing a Polite System Reset Using REISUB 194</p> <p>Fixing an Ubuntu System That Will Not Boot 195</p> <p>Checking BIOS 195</p> <p>Checking GRUB 195</p> <p>Reinstalling GRUB 195</p> <p>Using Recovery Mode 196</p> <p>Reinstalling Ubuntu 196</p> <p>Tips and Tricks 196</p> <p>Running the Previous Command 196</p> <p>Running Any Previous Command 197</p> <p>Running a Previous Command That Started with Specific Letters 197</p> <p>Running the Same Thing You Just Ran with a Different First Word 197</p> <p>Viewing Your History and More 197</p> <p>Doing Two or More Things 198</p> <p>Using Shortcuts 198</p> <p>Confining a Script to a Directory 198</p> <p>Using Coreutils 199</p> <p>Reading the Contents of the Kernel Ring Buffer with dmesg 200</p> <h3>Chapter 13 Managing Users 201</h3> <p>User Accounts 201</p> <p>The Super User/Root User 202</p> <p>User IDs and Group IDs 204</p> <p>File Permissions 204</p> <p>Managing Groups 205</p> <p>Group Listing 205</p> <p>Group Management Tools 206</p> <p>Managing Users 207</p> <p>User Management Tools 208</p> <p>Adding New Users 209</p> <p>Monitoring User Activity on the System 211</p> <p>Managing Passwords 212</p> <p>System Password Policy 212</p> <p>The Password File 212</p> <p>Shadow Passwords 214</p> <p>Managing Password Security for Users 216</p> <p>Changing Passwords in a Batch 216</p> <p>Granting System Administrator Privileges to Regular Users 217</p> <p>Temporarily Changing User Identity with the su Command 217</p> <p>Granting Root Privileges on Occasion: The sudo Command 219</p> <p>Disk Quotas 222</p> <p>Implementing Quotas 222</p> <p>Manually Configuring Quotas 223</p> <p>Related Ubuntu Commands 223</p> <h3>Chapter 14 Automating Tasks and Shell Scripting 225</h3> <p>What Is a Shell? 225</p> <p>Scheduling Tasks 226</p> <p>Using at and batch to Schedule Tasks for Later 227</p> <p>Using cron to Run Jobs Repeatedly 229</p> <p>Using rtcwake to Wake Your Computer from Sleep Automatically 231</p> <p>Basic Shell Control 233</p> <p>The Shell Command Line 233</p> <p>Shell Pattern-Matching Support 235</p> <p>Redirecting Input and Output 236</p> <p>Piping Data 237</p> <p>Background Processing 237</p> <p>Writing and Executing a Shell Script 237</p> <p>Running the New Shell Program 239</p> <p>Storing Shell Scripts for System-wide Access 240</p> <p>Interpreting Shell Scripts Through Specific Shells 240</p> <p>Using Variables in Shell Scripts 242</p> <p>Assigning a Value to a Variable 242</p> <p>Accessing Variable Values 243</p> <p>Positional Parameters 243</p> <p>A Simple Example of a Positional Parameter 243</p> <p>Using Positional Parameters to Access and Retrieve Variables from the Command Line 244</p> <p>Using a Simple Script to Automate Tasks 244</p> <p>Built-in Variables 246</p> <p>Special Characters 247</p> <p>Comparison of Expressions in pdksh and bash 250</p> <p>Comparing Expressions with tcsh 255</p> <p>The for Statement 259</p> <p>The while Statement 261</p> <p>The until Statement 263</p> <p>The repeat Statement (tcsh) 263</p> <p>The select Statement (pdksh) 264</p> <p>The shift Statement 264</p> <p>The if Statement 265</p> <p>The expr Statement 266</p> <p>The case Statement 267</p> <p>The break and exit Statements 269</p> <p>Using Functions in Shell Scripts 269</p> <h3>Chapter 15 The Boot Process 271</h3> <p>Running Services at Boot 271</p> <p>Beginning the Boot Loading Process 272</p> <p>Loading the Linux Kernel 274</p> <p>Starting and Stopping Services with systemd 275</p> <p>Controlling Services at Boot with Administrative Tools 278</p> <p>Troubleshooting Runlevel Problems 278</p> <p>Boot-Repair 278</p> <h3>Chapter 16 System-Monitoring Tools 281</h3> <p>Console-Based Monitoring 281</p> <p>Using the kill Command to Control Processes 283</p> <p>Using Priority Scheduling and Control 285</p> <p>Displaying Free and Used Memory with free 286</p> <p>Disk Space 286</p> <p>Disk Quotas 287</p> <p>Checking Log Files 287</p> <p>Rotating Log Files 289</p> <p>Graphical Process- and System-Management Tools 292</p> <p>System Monitor 292</p> <p>Conky 292</p> <p>Other Graphical Process- and System-Monitoring Tools 297</p> <p>KDE Process- and System-Monitoring Tools 298</p> <p>Enterprise Server Monitoring 298</p> <h3>Chapter 17 Backing Up 301</h3> <p>Choosing a Backup Strategy 301</p> <p>Why Data Loss Occurs 302</p> <p>Assessing Your Backup Needs and Resources 303</p> <p>Evaluating Backup Strategies 304</p> <p>Making the Choice 308</p> <p>Choosing Backup Hardware and Media 308</p> <p>External Hard Drive 308</p> <p>Network Storage 308</p> <p>Tape Drive Backups 309</p> <p>Cloud Storage 309</p> <p>Using Backup Software 309</p> <p>tar: The Most Basic Backup Tool 310</p> <p>The GNOME File Roller 312</p> <p>The KDE ark Archiving Tool 312</p> <p>Déjà Dup 313</p> <p>Back In Time 314</p> <p>Unison 315</p> <p>Amanda 315</p> <p>Alternative Backup Software 316</p> <p>Copying Files 316</p> <p>Copying Files Using tar 317</p> <p>Compressing, Encrypting, and Sending tar Streams 318</p> <p>Copying Files Using cp 318</p> <p>Using rsync 319</p> <p>Version Control for Configuration Files 320</p> <p>System Rescue 323</p> <p>The Ubuntu Rescue Disc 323</p> <p>Restoring the GRUB2 Boot Loader 323</p> <p>Saving Files from a Nonbooting Hard Drive 324</p> <h3>Chapter 18 Networking 325</h3> <p>Laying the Foundation: The localhost Interface 326</p> <p>Checking for the Availability of the Loopback Interface 326</p> <p>Configuring the Loopback Interface Manually 327</p> <p>Checking Connections with ping, traceroute, and mtr 328</p> <p>Networking with TCP/IP 330</p> <p>TCP/IP Addressing 331</p> <p>Using IP Masquerading in Ubuntu 332</p> <p>Ports 333</p> <p>IPv6 Basics 334</p> <p>Network Organization 337</p> <p>Subnetting 337</p> <p>Subnet Masks 337</p> <p>Broadcast, Unicast, and Multicast Addressing 338</p> <p>Hardware Devices for Networking 338</p> <p>Network Interface Cards 338</p> <p>Network Cable 340</p> <p>Hubs and Switches 342</p> <p>Routers and Bridges 343</p> <p>Initializing New Network Hardware 343</p> <p>Using Network Configuration Tools 345</p> <p>Command-Line Network Interface Configuration 346</p> <p>Network Configuration Files 350</p> <p>Using Graphical Configuration Tools 355</p> <p>Dynamic Host Configuration Protocol 355</p> <p>How DHCP Works 356</p> <p>Activating DHCP at Installation and Boot Time 357</p> <p>DHCP Software Installation and Configuration 358</p> <p>Using DHCP to Configure Network Hosts 359</p> <p>Other Uses for DHCP 361</p> <p>Wireless Networking 361</p> <p>Support for Wireless Networking in Ubuntu 361</p> <p>Choosing from Among Available Wireless Protocols 363</p> <p>Beyond the Network and onto the Internet 363</p> <p>Common Configuration Information 364</p> <p>Configuring Digital Subscriber Line Access 365</p> <p>Understanding PPP over Ethernet 366</p> <p>Configuring a PPPoE Connection Manually 366</p> <p>Configuring Dial-up Internet Access 367</p> <p>Troubleshooting Connection Problems 368</p> <h3>Chapter 19 Remote Access with SSH and VNC 371</h3> <p>Setting Up an SSH Server 371</p> <p>SSH Tools 372</p> <p>Using scp to Copy Individual Files Between Machines 372</p> <p>Using sftp to Copy Many Files Between Machines 373</p> <p>Using ssh-keygen to Enable Key-Based Logins 373</p> <p>Virtual Network Computing 375</p> <p>Guacamole 377</p> <h3>Chapter 20 Securing Your Machines 379</h3> <p>Understanding Computer Attacks 379</p> <p>Assessing Your Vulnerability 381</p> <p>Protecting Your Machine 382</p> <p>Securing a Wireless Network 382</p> <p>Passwords and Physical Security 383</p> <p>Configuring and Using Tripwire 384</p> <p>Securing Devices 385</p> <p>Viruses 385</p> <p>Configuring Your Firewall 386</p> <p>AppArmor 388</p> <p>Forming a Disaster Recovery Plan 390</p> <h3>Chapter 21 Performance Tuning 393</h3> <p>Storage Disk 394</p> <p>Linux File Systems 394</p> <p>The hdparm Command 395</p> <p>File System Tuning 396</p> <p>The tune2fs Command 396</p> <p>The e2fsck Command 397</p> <p>The badblocks Command 397</p> <p>Disabling File Access Time 397</p> <p>Kernel 398</p> <p>Tuned 399</p> <h3>Chapter 22 Kernel and Module Management 401</h3> <p>The Linux Kernel 402</p> <p>The Linux Source Tree 403</p> <p>Types of Kernels 405</p> <p>Managing Modules 406</p> <p>When to Recompile 408</p> <p>Kernel Versions 409</p> <p>Obtaining the Kernel Sources 409</p> <p>Patching the Kernel 410</p> <p>Compiling the Kernel 412</p> <p>Using xconfig to Configure the Kernel 414</p> <p>Creating an Initial RAM Disk Image 418</p> <p>When Something Goes Wrong 418</p> <p>Errors During Compile 418</p> <p>Runtime Errors, Boot Loader Problems, and Kernel Oops 419</p> <h2>PART IV: UBUNTU AS A SERVER</h2> <h3>Chapter 23 Sharing Files and Printers 421</h3> <p>Using Network File System 422</p> <p>Installing and Starting or Stopping NFS 422</p> <p>NFS Server Configuration 422</p> <p>NFS Client Configuration 423</p> <p>Putting Samba to Work 424</p> <p>Manually Configuring Samba with /etc/samba/smb conf 426</p> <p>Testing Samba with the testparm Command 429</p> <p>Starting, Stopping, and Restarting the smbd Daemon 429</p> <p>Mounting Samba Shares 430</p> <p>Network and Remote Printing with Ubuntu 431</p> <p>Creating Network Printers 431</p> <p>Using the CUPS GUI 433</p> <p>Avoiding Printer Support Problems 434</p> <h3>Chapter 24 Common Web Server Stacks 437</h3> <p>LAMP 437</p> <p>LEMP 439</p> <p>MEAN 440</p> <h3>Chapter 25 Apache Web Server Management 443</h3> <p>About the Apache Web Server 443</p> <p>Installing the Apache Server 444</p> <p>Starting and Stopping Apache 444</p> <p>Runtime Server Configuration Settings 446</p> <p>Runtime Configuration Directives 446</p> <p>Editing apache2 conf 447</p> <p>Apache Multiprocessing Modules 449</p> <p>Using htaccess Configuration Files 450</p> <p>File System Authentication and Access Control 452</p> <p>Restricting Access with Require 452</p> <p>Authentication 453</p> <p>Final Words on Access Control 455</p> <p>Apache Modules 455</p> <p>mod_access 456</p> <p>mod_alias 456</p> <p>mod_asis 456</p> <p>mod_auth 457</p> <p>mod_auth_anon 457</p> <p>mod_auth_dbm 457</p> <p>mod_auth_digest 457</p> <p>mod_autoindex4 58</p> <p>mod_cgi 458</p> <p>mod_dir and mod_env 458</p> <p>mod_expires 458</p> <p>mod_headers 458</p> <p>mod_include 459</p> <p>mod_info and mod_log_config 459</p> <p>mod_mime and mod_mime_magic 459</p> <p>mod_negotiation 459</p> <p>mod_rewrite 459</p> <p>mod_setenvif 460</p> <p>mod_speling 460</p> <p>mod_status 460</p> <p>mod_ssl 460</p> <p>mod_unique_id 460</p>