Introduction |
|
xxix | |
Assessment Test |
|
xlii | |
Part I Gathering Your Tools |
|
1 | (122) |
|
Chapter 1 Preparing Your Environment |
|
|
3 | (12) |
|
Setting Up a Learning Space |
|
|
4 | (4) |
|
|
4 | (1) |
|
Creating a Virtualized Environment |
|
|
5 | (2) |
|
|
7 | (1) |
|
Exploring Linux Distributions |
|
|
8 | (6) |
|
|
9 | (1) |
|
|
10 | (2) |
|
|
12 | (1) |
|
|
13 | (1) |
|
|
14 | (1) |
|
|
14 | (1) |
|
Chapter 2 Sifting Through Services |
|
|
15 | (24) |
|
|
16 | (3) |
|
|
17 | (1) |
|
|
18 | (1) |
|
|
19 | (5) |
|
|
20 | (1) |
|
|
21 | (1) |
|
|
22 | (2) |
|
|
24 | (5) |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
26 | (3) |
|
|
29 | (3) |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
32 | (1) |
|
|
32 | (1) |
|
|
32 | (1) |
|
|
32 | (1) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
35 | (4) |
|
Chapter 3 Managing Files, Directories, and Text |
|
|
39 | (44) |
|
Handling Files and Directories |
|
|
40 | (15) |
|
Viewing and Creating Files |
|
|
40 | (5) |
|
|
45 | (7) |
|
|
52 | (3) |
|
Linking Files and Directories |
|
|
55 | (4) |
|
|
55 | (2) |
|
|
57 | (2) |
|
|
59 | (7) |
|
Reading Entire Text Files |
|
|
59 | (2) |
|
Reading Text File Portions |
|
|
61 | (4) |
|
|
65 | (1) |
|
|
66 | (11) |
|
Exploring File Differences |
|
|
67 | (2) |
|
Using Simple Pinpoint Commands |
|
|
69 | (4) |
|
Using Intricate Pinpoint Commands |
|
|
73 | (4) |
|
|
77 | (1) |
|
|
77 | (1) |
|
|
78 | (5) |
|
Chapter 4 Searching and Analyzing Text |
|
|
83 | (40) |
|
|
84 | (11) |
|
|
84 | (5) |
|
|
89 | (4) |
|
|
93 | (2) |
|
Redirecting Input and Output |
|
|
95 | (10) |
|
|
95 | (1) |
|
Redirecting Standard Error |
|
|
96 | (2) |
|
Regulating Standard Input |
|
|
98 | (2) |
|
|
100 | (2) |
|
|
102 | (1) |
|
|
103 | (2) |
|
|
105 | (11) |
|
Appreciating Text Editors |
|
|
105 | (5) |
|
Learning About Stream Editors |
|
|
110 | (6) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
118 | (5) |
Part II Starting Up and Configuring Your System |
|
123 | (150) |
|
Chapter 5 Explaining the Boot Process |
|
|
125 | (22) |
|
|
126 | (2) |
|
Following the Boot Process |
|
|
126 | (1) |
|
|
127 | (1) |
|
|
128 | (2) |
|
|
128 | (1) |
|
|
129 | (1) |
|
|
130 | (7) |
|
|
131 | (3) |
|
|
134 | (2) |
|
|
136 | (1) |
|
|
137 | (4) |
|
|
137 | (2) |
|
|
139 | (2) |
|
|
141 | (1) |
|
|
141 | (2) |
|
|
143 | (4) |
|
Chapter 6 Maintaining System Startup and Services |
|
|
147 | (40) |
|
|
148 | (1) |
|
|
149 | (18) |
|
|
150 | (2) |
|
Focusing on Service Unit Files |
|
|
152 | (5) |
|
Focusing on Target Unit Files |
|
|
157 | (2) |
|
|
159 | (3) |
|
Examining Special systemd Commands |
|
|
162 | (5) |
|
Managing SysV init Systems |
|
|
167 | (9) |
|
|
168 | (3) |
|
Investigating SysV init Commands |
|
|
171 | (5) |
|
Digging Deeper into systemd |
|
|
176 | (3) |
|
Looking at systemd Mount Units |
|
|
176 | (2) |
|
Exploring Automount Units |
|
|
178 | (1) |
|
|
179 | (1) |
|
|
179 | (2) |
|
|
181 | (6) |
|
Chapter 7 Configuring Network Connections |
|
|
187 | (30) |
|
Configuring Network Features |
|
|
188 | (13) |
|
Network Configuration Files |
|
|
188 | (3) |
|
|
191 | (2) |
|
|
193 | (8) |
|
Basic Network Troubleshooting |
|
|
201 | (4) |
|
|
201 | (1) |
|
|
202 | (3) |
|
Advanced Network Troubleshooting |
|
|
205 | (4) |
|
|
205 | (3) |
|
|
208 | (1) |
|
|
209 | (1) |
|
|
210 | (2) |
|
|
212 | (5) |
|
|
217 | (36) |
|
|
218 | (13) |
|
|
219 | (2) |
|
|
221 | (2) |
|
|
223 | (2) |
|
Making Acquaintance with MATE |
|
|
225 | (2) |
|
|
227 | (1) |
|
|
228 | (3) |
|
|
231 | (4) |
|
|
232 | (2) |
|
|
234 | (1) |
|
|
235 | (5) |
|
|
236 | (2) |
|
|
238 | (1) |
|
|
239 | (1) |
|
|
240 | (1) |
|
|
240 | (5) |
|
|
242 | (1) |
|
|
243 | (1) |
|
Tunneling Your X11 Connection |
|
|
244 | (1) |
|
|
245 | (1) |
|
|
245 | (2) |
|
|
247 | (6) |
|
Chapter 9 Adjusting Localization Options |
|
|
253 | (20) |
|
Understanding Localization |
|
|
254 | (2) |
|
|
254 | (1) |
|
|
255 | (1) |
|
|
256 | (3) |
|
Installation Locale Decisions |
|
|
256 | (1) |
|
|
257 | (2) |
|
|
259 | (6) |
|
|
259 | (1) |
|
Setting the Time and Date |
|
|
260 | (4) |
|
|
264 | (1) |
|
|
265 | (1) |
|
|
266 | (1) |
|
|
267 | (6) |
Part III Managing Your System |
|
273 | (136) |
|
Chapter 10 Administering Users and Groups |
|
|
275 | (40) |
|
|
276 | (18) |
|
|
276 | (12) |
|
|
288 | (2) |
|
|
290 | (2) |
|
|
292 | (2) |
|
|
294 | (3) |
|
Setting Up the Environment |
|
|
297 | (3) |
|
|
298 | (1) |
|
Understanding User Entries |
|
|
299 | (1) |
|
|
300 | (1) |
|
|
300 | (4) |
|
Exploring the whoami Utility |
|
|
300 | (1) |
|
Understanding the who Utility |
|
|
301 | (1) |
|
Identifying with the id Program |
|
|
302 | (1) |
|
Displaying Access History with the last Utility |
|
|
303 | (1) |
|
Managing Disk Space Usage |
|
|
304 | (4) |
|
|
308 | (1) |
|
|
308 | (2) |
|
|
310 | (5) |
|
Chapter 11 Handling Storage |
|
|
315 | (28) |
|
|
316 | (2) |
|
|
316 | (1) |
|
|
317 | (1) |
|
Automatic Drive Detection |
|
|
317 | (1) |
|
|
318 | (5) |
|
|
318 | (2) |
|
|
320 | (2) |
|
|
322 | (1) |
|
|
322 | (1) |
|
Understanding Filesystems |
|
|
323 | (3) |
|
|
324 | (2) |
|
Maneuvering Around the Filesystem |
|
|
326 | (1) |
|
|
326 | (3) |
|
|
326 | (2) |
|
|
328 | (1) |
|
|
329 | (2) |
|
Manually Mounting Devices |
|
|
329 | (1) |
|
Automatically Mounting Devices |
|
|
330 | (1) |
|
|
331 | (2) |
|
Retrieving Filesystem Stats |
|
|
331 | (1) |
|
|
332 | (1) |
|
|
333 | (5) |
|
|
333 | (1) |
|
|
334 | (2) |
|
|
336 | (2) |
|
|
338 | (1) |
|
|
338 | (2) |
|
|
340 | (3) |
|
Chapter 12 Protecting Files |
|
|
343 | (30) |
|
Understanding Backup Types |
|
|
344 | (2) |
|
Looking at Compression Methods |
|
|
346 | (3) |
|
Comparing Archive and Restore Utilities |
|
|
349 | (13) |
|
|
349 | (3) |
|
|
352 | (5) |
|
|
357 | (2) |
|
|
359 | (3) |
|
Securing Offsite/Off-System Backups |
|
|
362 | (4) |
|
|
362 | (1) |
|
Transferring Securely via sftp |
|
|
363 | (3) |
|
Checking Backup Integrity |
|
|
366 | (2) |
|
Digesting an MD5 Algorithm |
|
|
366 | (1) |
|
|
367 | (1) |
|
|
368 | (1) |
|
|
368 | (2) |
|
|
370 | (3) |
|
Chapter 13 Governing Software |
|
|
373 | (24) |
|
|
374 | (6) |
|
|
374 | (1) |
|
Bundling Source Code Packages |
|
|
375 | (4) |
|
|
379 | (1) |
|
|
380 | (12) |
|
Installing and Managing Packages |
|
|
381 | (4) |
|
Understanding Repositories |
|
|
385 | (7) |
|
|
392 | (1) |
|
|
393 | (1) |
|
|
394 | (3) |
|
Chapter 14 Tending Kernel Modules |
|
|
397 | (12) |
|
|
398 | (4) |
|
Installing Kernel Modules |
|
|
402 | (2) |
|
|
404 | (1) |
|
|
405 | (1) |
|
|
405 | (2) |
|
|
407 | (2) |
Part IV Securing Your System |
|
409 | (124) |
|
Chapter 15 Applying Ownership and Permissions |
|
|
411 | (28) |
|
Looking at File and Directory Permissions |
|
|
412 | (8) |
|
|
412 | (2) |
|
Controlling Access Permissions |
|
|
414 | (3) |
|
Exploring Special Permissions |
|
|
417 | (1) |
|
Managing Default Permissions |
|
|
418 | (2) |
|
|
420 | (2) |
|
Context-Based Permissions |
|
|
422 | (8) |
|
|
423 | (4) |
|
|
427 | (3) |
|
Understanding Linux User Types |
|
|
430 | (1) |
|
|
430 | (1) |
|
|
430 | (1) |
|
|
431 | (4) |
|
|
435 | (1) |
|
|
436 | (1) |
|
|
437 | (2) |
|
Chapter 16 Looking at Access and Authentication Methods |
|
|
439 | (34) |
|
|
440 | (12) |
|
Exploring PAM Configuration Files |
|
|
440 | (4) |
|
Enforcing Strong Passwords |
|
|
444 | (3) |
|
|
447 | (4) |
|
|
451 | (1) |
|
|
452 | (3) |
|
|
453 | (1) |
|
|
453 | (1) |
|
|
454 | (1) |
|
|
455 | (1) |
|
|
455 | (13) |
|
Exploring Basic SSH Concepts |
|
|
456 | (2) |
|
|
458 | (2) |
|
|
460 | (2) |
|
Authenticating with SSH Keys |
|
|
462 | (2) |
|
Authenticating with the Authentication Agent |
|
|
464 | (2) |
|
|
466 | (2) |
|
|
468 | (1) |
|
|
469 | (1) |
|
|
469 | (2) |
|
|
471 | (2) |
|
Chapter 17 Implementing Logging Services |
|
|
473 | (14) |
|
Understanding the Importance of Logging |
|
|
474 | (3) |
|
|
474 | (2) |
|
The History of Linux Logging |
|
|
476 | (1) |
|
Basic Logging Using rsyslog |
|
|
477 | (3) |
|
|
477 | (2) |
|
|
479 | (1) |
|
|
479 | (1) |
|
Journaling with systemd-journald |
|
|
480 | (3) |
|
|
480 | (1) |
|
|
481 | (2) |
|
|
483 | (1) |
|
|
484 | (1) |
|
|
485 | (2) |
|
Chapter 18 Overseeing Linux Firewalls |
|
|
487 | (26) |
|
|
488 | (2) |
|
Looking at Firewall Technologies |
|
|
490 | (15) |
|
Familiarizing Yourself with firewalld |
|
|
491 | (4) |
|
|
495 | (5) |
|
|
500 | (5) |
|
|
505 | (1) |
|
Dynamically Setting Rules |
|
|
506 | (2) |
|
|
506 | (1) |
|
|
506 | (1) |
|
|
507 | (1) |
|
|
508 | (1) |
|
|
508 | (2) |
|
|
510 | (3) |
|
Chapter 19 Embracing Best Security Practices |
|
|
513 | (20) |
|
|
514 | (4) |
|
|
514 | (2) |
|
Multifactor Authentication |
|
|
516 | (1) |
|
|
517 | (1) |
|
Restricting the root Account |
|
|
517 | (1) |
|
|
518 | (7) |
|
|
518 | (1) |
|
|
519 | (1) |
|
|
520 | (1) |
|
Preventing Unauthorized Rebooting |
|
|
520 | (2) |
|
Restricting Unapproved Jobs |
|
|
522 | (1) |
|
|
523 | (1) |
|
|
523 | (1) |
|
|
524 | (1) |
|
|
524 | (1) |
|
|
525 | (3) |
|
|
525 | (1) |
|
Disabling Unused Services |
|
|
525 | (1) |
|
|
526 | (1) |
|
Using Encryption on the Network |
|
|
526 | (2) |
|
|
528 | (1) |
|
|
528 | (2) |
|
|
530 | (3) |
Part V Troubleshooting Your System |
|
533 | (116) |
|
Chapter 20 Analyzing System Properties and Remediation |
|
|
535 | (32) |
|
Troubleshooting the Network |
|
|
536 | (13) |
|
|
536 | (4) |
|
Viewing Network Performance |
|
|
540 | (6) |
|
Reviewing the Network's Configuration |
|
|
546 | (3) |
|
Troubleshooting Storage Issues |
|
|
549 | (5) |
|
Running Out of Filesystem Space |
|
|
549 | (1) |
|
|
550 | (3) |
|
|
553 | (1) |
|
|
554 | (2) |
|
|
556 | (4) |
|
|
556 | (4) |
|
|
560 | (1) |
|
Surviving a Lost root Password |
|
|
560 | (2) |
|
|
562 | (1) |
|
|
562 | (1) |
|
|
563 | (4) |
|
Chapter 21 Optimizing Performance |
|
|
567 | (14) |
|
|
568 | (2) |
|
Monitoring Processes in Real Time |
|
|
570 | (3) |
|
|
573 | (4) |
|
|
574 | (1) |
|
|
574 | (3) |
|
|
577 | (1) |
|
|
577 | (2) |
|
|
579 | (2) |
|
Chapter 22 Investigating User Issues |
|
|
581 | (16) |
|
|
582 | (6) |
|
|
582 | (4) |
|
|
586 | (1) |
|
|
587 | (1) |
|
|
588 | (3) |
|
|
588 | (1) |
|
|
589 | (1) |
|
|
590 | (1) |
|
Exploring Environment and Shell Issues |
|
|
591 | (2) |
|
|
593 | (1) |
|
|
593 | (1) |
|
|
594 | (3) |
|
Chapter 23 Dealing with Linux Devices |
|
|
597 | (22) |
|
Communicating with Linux Devices |
|
|
598 | (7) |
|
|
598 | (2) |
|
|
600 | (1) |
|
|
601 | (3) |
|
|
604 | (1) |
|
|
605 | (8) |
|
|
605 | (3) |
|
|
608 | (1) |
|
|
609 | (1) |
|
|
610 | (1) |
|
|
611 | (2) |
|
Using Hot Pluggable Devices |
|
|
613 | (2) |
|
Detecting Dynamic Devices |
|
|
613 | (1) |
|
Working with Dynamic Devices |
|
|
614 | (1) |
|
|
615 | (1) |
|
|
616 | (1) |
|
|
617 | (2) |
|
Chapter 24 Troubleshooting Application and Hardware Issues |
|
|
619 | (30) |
|
Dealing with Storage Problems |
|
|
620 | (6) |
|
|
620 | (2) |
|
Dealing with Specialized Issues |
|
|
622 | (4) |
|
Uncovering Application Permission Issues |
|
|
626 | (2) |
|
Analyzing Application Dependencies |
|
|
628 | (5) |
|
|
629 | (1) |
|
|
629 | (1) |
|
|
630 | (1) |
|
|
630 | (1) |
|
Exploring Environment Variable Issues |
|
|
631 | (1) |
|
Gaining GCC Compatibility |
|
|
631 | (1) |
|
Perusing Repository Problems |
|
|
632 | (1) |
|
Looking at SELinux Context Violations |
|
|
633 | (1) |
|
Exploring Firewall Blockages |
|
|
633 | (2) |
|
|
633 | (1) |
|
|
634 | (1) |
|
|
635 | (1) |
|
Troubleshooting Additional Hardware Issues |
|
|
635 | (8) |
|
Looking at Helpful Hardware Commands |
|
|
635 | (4) |
|
Investigating Other Hardware Problems |
|
|
639 | (4) |
|
|
643 | (1) |
|
|
643 | (2) |
|
|
645 | (4) |
Part VI Automating Your System |
|
649 | (68) |
|
Chapter 25 Deploying Bash Scripts |
|
|
651 | (26) |
|
The Basics of Shell Scripting |
|
|
652 | (5) |
|
Running Multiple Commands |
|
|
652 | (1) |
|
|
653 | (1) |
|
|
654 | (1) |
|
|
655 | (1) |
|
|
656 | (1) |
|
|
657 | (6) |
|
|
657 | (1) |
|
|
658 | (3) |
|
|
661 | (1) |
|
|
662 | (1) |
|
|
663 | (10) |
|
|
663 | (1) |
|
|
664 | (2) |
|
|
666 | (3) |
|
|
669 | (4) |
|
|
673 | (1) |
|
|
674 | (1) |
|
|
675 | (2) |
|
Chapter 26 Automating Jobs |
|
|
677 | (20) |
|
Running Scripts in Background Mode |
|
|
678 | (2) |
|
Running in the Background |
|
|
678 | (1) |
|
Running Multiple Background Jobs |
|
|
679 | (1) |
|
Running Scripts Without a Console |
|
|
680 | (1) |
|
|
681 | (2) |
|
|
682 | (1) |
|
|
682 | (1) |
|
|
683 | (4) |
|
|
683 | (3) |
|
|
686 | (1) |
|
|
687 | (5) |
|
Scheduling a Job Using the at Command |
|
|
687 | (3) |
|
Scheduling Regular Scripts |
|
|
690 | (2) |
|
|
692 | (1) |
|
|
693 | (1) |
|
|
694 | (3) |
|
Chapter 27 Controlling Versions with Git |
|
|
697 | (20) |
|
Understanding Version Control |
|
|
698 | (2) |
|
Setting Up Your Git Environment |
|
|
700 | (3) |
|
|
703 | (7) |
|
|
710 | (3) |
|
|
713 | (1) |
|
|
713 | (2) |
|
|
715 | (2) |
Part VII Realizing Virtual and Cloud Environments |
|
717 | (52) |
|
Chapter 28 Understanding Cloud and Virtualization Concepts |
|
|
719 | (16) |
|
Considering Cloud Services |
|
|
720 | (3) |
|
|
720 | (1) |
|
What Are the Cloud Services? |
|
|
721 | (2) |
|
Understanding Virtualization |
|
|
723 | (4) |
|
|
723 | (2) |
|
|
725 | (1) |
|
|
726 | (1) |
|
|
727 | (2) |
|
|
727 | (1) |
|
|
728 | (1) |
|
|
729 | (1) |
|
|
729 | (1) |
|
|
730 | (1) |
|
|
731 | (1) |
|
|
732 | (3) |
|
Chapter 29 Inspecting Cloud and Virtualization Services |
|
|
735 | (20) |
|
|
736 | (4) |
|
|
736 | (1) |
|
|
737 | (1) |
|
Managing with Virtual Machine Manager |
|
|
738 | (2) |
|
Understanding Bootstrapping |
|
|
740 | (6) |
|
Booting with Shell Scripts |
|
|
740 | (1) |
|
Kick-Starting with Anaconda |
|
|
741 | (3) |
|
Initializing with Cloud-init |
|
|
744 | (2) |
|
|
746 | (1) |
|
Considering Network Configurations |
|
|
747 | (3) |
|
|
747 | (1) |
|
Configuring Virtualized NICs |
|
|
748 | (2) |
|
|
750 | (1) |
|
|
751 | (1) |
|
|
752 | (3) |
|
Chapter 30 Orchestrating the Environment |
|
|
755 | (14) |
|
Understanding Orchestration Concepts |
|
|
756 | (4) |
|
|
757 | (1) |
|
|
758 | (2) |
|
Provisioning the Data Center |
|
|
760 | (3) |
|
Coding the Infrastructure |
|
|
761 | (1) |
|
Automating the Infrastructure |
|
|
762 | (1) |
|
Comparing Agent and Agentless |
|
|
762 | (1) |
|
Investigating the Inventory |
|
|
763 | (1) |
|
Looking at Container Orchestration Engines |
|
|
763 | (2) |
|
|
763 | (1) |
|
|
764 | (1) |
|
|
764 | (1) |
|
|
765 | (1) |
|
|
765 | (1) |
|
|
766 | (3) |
Appendix Answers to Review Questions |
|
769 | (68) |
|
Chapter 2 Sifting Through Services |
|
|
770 | (3) |
|
Chapter 3 Managing Files, Directories, and Text |
|
|
773 | (4) |
|
Chapter 4 Searching and Analyzing Text |
|
|
777 | (4) |
|
Chapter 5 Explaining the Boot Process |
|
|
781 | (3) |
|
Chapter 6 Maintaining System Startup and Services |
|
|
784 | (4) |
|
Chapter 7 Configuring Network Connections |
|
|
788 | (3) |
|
|
791 | (4) |
|
Chapter 9 Adjusting Localization Options |
|
|
795 | (3) |
|
Chapter 10 Administering Users and Groups |
|
|
798 | (3) |
|
Chapter 11 Handling Storage |
|
|
801 | (2) |
|
Chapter 12 Protecting Files |
|
|
803 | (1) |
|
Chapter 13 Governing Software |
|
|
804 | (2) |
|
Chapter 14 Tending Kernel Modules |
|
|
806 | (2) |
|
Chapter 15 Applying Ownership and Permissions |
|
|
808 | (2) |
|
Chapter 16 Looking at Access and Authentication Methods |
|
|
810 | (1) |
|
Chapter 17 Implementing Logging Services |
|
|
811 | (2) |
|
Chapter 18 Overseeing Linux Firewalls |
|
|
813 | (2) |
|
Chapter 19 Embracing Best Security Practices |
|
|
815 | (2) |
|
Chapter 20 Embracing Best Security Practices |
|
|
817 | (1) |
|
Chapter 21 Optimizing Performance |
|
|
818 | (2) |
|
Chapter 22 Investigating User Issues |
|
|
820 | (2) |
|
Chapter 23 Dealing with Linux Devices |
|
|
822 | (2) |
|
Chapter 24 Troubleshooting Application and Hardware Issues |
|
|
824 | (2) |
|
Chapter 25 Deploying Bash Scripts |
|
|
826 | (1) |
|
Chapter 26 Automating Jobs |
|
|
827 | (2) |
|
Chapter 27 Controlling Versions with Git |
|
|
829 | (2) |
|
Chapter 28 Understanding Cloud and Virtualization Concepts |
|
|
831 | (1) |
|
Chapter 29 Inspecting Cloud and Virtualization Services |
|
|
832 | (2) |
|
Chapter 30 Orchestrating the Environment |
|
|
834 | (3) |
Index |
|
837 | |