40,99 €
The industry gold standard in Linux guides, fully updated
In the newly updated eleventh edition of the Linux Bible, veteran Linux author and trainer Christopher Negus walks you through the latest and most popular Linux distributions, including Red Hat Enterprise 9, Ubuntu 24 LTS, and Fedora 41. Whether you're a brand new or power user, you'll learn hands-on ways to become skilled at the world's most important operating system.
This edition expands coverage of Linux in cloud environments, such as the AWS cloud, and on-premises environments (with enhanced data center management features). You'll learn techniques for managing storage, users, and security, while familiarizing yourself with administrative techniques using the clear explanations and step-by-step instructions that this series is known for.
Also inside:
Linux Bible, 11th Edition is the single, comprehensive resource you need to get you on track in a flash. Grab your copy today.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 1554
Veröffentlichungsjahr: 2025
Cover
Table of Contents
Title Page
Copyright
Dedication
About the Author
About the Technical Editor
Acknowledgments
Introduction
Part I: Getting Started
CHAPTER 1: Starting with Linux
Understanding What Linux Is
Understanding How Linux Differs from Other Operating Systems
Exploring Linux History
Understanding How Linux Distributions Emerged
Finding Professional Opportunities with Linux Today
Summary
CHAPTER 2: Creating the Perfect Linux Desktop
Understanding Linux Desktop Technology
Starting with the Fedora GNOME Desktop Live Image
Using the GNOME Desktop
Configuring a Developer Desktop
Summary
Exercises
Part II: Becoming a Linux Power User
CHAPTER 3: Using the Shell
About Shells and Terminal Windows
Choosing Your Shell
Running Commands
Recalling Commands Using Command History
Connecting and Expanding Commands
Using Shell Variables
Creating Your Shell Environment
Getting Information about Commands
Summary
Exercises
CHAPTER 4: Moving Around the Filesystem
Using Basic Filesystem Commands
Using Metacharacters and Operators
Listing Files and Directories
Understanding File Permissions and Ownership
Moving, Copying, and Removing Files
Summary
Exercises
CHAPTER 5: Working with Text Files
Editing Files with
vim
and
vi
Finding Files
Summary
Exercises
CHAPTER 6: Managing Running Processes
Understanding Processes
Listing Processes
Managing Background and Foreground Processes
Killing and Renicing Processes
Limiting Processes with cgroups
Summary
Exercises
CHAPTER 7: Writing Simple Shell Scripts
Understanding Shell Scripts
Summary
Exercises
Part III: Becoming a Linux System Administrator
CHAPTER 8: Learning System Administration
Understanding System Administration
Using Graphical Administration Tools
Using the root User Account
Exploring Administrative Commands, Configuration Files, and Log Files
Using Other Administrative Accounts
Checking and Configuring Hardware
Summary
Exercises
CHAPTER 9: Installing Linux
Quick Starting Linux Installation
Choosing a Computer
Installing Red Hat Enterprise Linux from Installation Media
Understanding Cloud‐Based Installations
Installing Linux in the Enterprise
Exploring Common Installation Topics
Summary
Exercises
CHAPTER 10: Getting and Managing Software
Managing Software on the Desktop
Going Beyond the Software Window
Understanding Linux RPM and DEB Software Packaging
Managing RPM Packages with
dnf
and
yum
Installing, Querying, and Verifying Software with the
rpm
Command
Managing Software in the Enterprise
Summary
Exercises
CHAPTER 11: Managing User Accounts
Creating User Accounts
Understanding Group Accounts
Managing Users in the Enterprise
Centralizing User Accounts
Summary
Exercises
CHAPTER 12: Managing Disks and Filesystems
Understanding Disk Storage
Partitioning Hard Disks
Using Logical Volume Manager Partitions
Mounting Filesystems
Using the
mkfs
Command to Create a Filesystem
Managing Storage with Cockpit
Summary
Exercises
Part IV: Becoming a Linux Server Administrator
CHAPTER 13: Understanding Server Administration
Starting with Server Administration
Checking and Setting Servers
Managing Remote Access with the Secure Shell Service
Configuring System Logging
Checking System Resources with sar
Checking System Space
Managing Servers in the Enterprise
Summary
Exercises
CHAPTER 14: Administering Networking
Configuring Networking for Desktops
Configuring Networking from the Command Line
Configuring Networking in the Enterprise
Summary
Exercises
CHAPTER 15: Starting and Stopping Services
Understanding the Initialization Daemon
Stopping and Starting Services
Enabling Persistent Services
Configuring a Default Runlevel or Target Unit
Adding New or Customized Services
Summary
Exercises
CHAPTER 16: Configuring a Print Server
Common UNIX Printing System
Setting Up Printers
Working with CUPS Printing
Using Printing Commands
Configuring Print Servers
Summary
Exercises
CHAPTER 17: Configuring a Web Server
Understanding the Apache Web Server
Getting and Installing Your Web Server
Starting Apache
Troubleshooting Your Web Server
Exploring web server deployment
Summary
Exercises
CHAPTER 18: Configuring an FTP Server
Understanding FTP
Installing the vsftpd FTP Server
Starting the vsftpd Service
Securing Your FTP Server
Configuring Your FTP Server
Using FTP Clients to Connect to Your Server
Summary
Exercises
CHAPTER 19: Configuring a Windows File Sharing (Samba) Server
Understanding Samba
Installing Samba
Starting and Stopping Samba
Securing Samba
Configuring Samba
Accessing Samba Shares
Using Samba in the Enterprise
Summary
Exercises
CHAPTER 20: Configuring an NFS File Server
Installing an NFS Server
Starting the NFS service
Sharing NFS Filesystems
Securing Your NFS Server
Using NFS Filesystems
Unmounting NFS filesystems
Summary
Exercises
CHAPTER 21: Troubleshooting Linux
Boot‐Up Troubleshooting
Troubleshooting Software Packages
Troubleshooting Networking
Troubleshooting Memory
Troubleshooting in Rescue Mode
Summary
Exercises
CHAPTER 22: Configuring an Artificial Intelligence Chatbot
Choosing Language Models
Evaluating Your AI Requirements
Getting Ollama to Serve Language Models
Summary
Exercises
Part VI: Learning Linux Security Techniques
CHAPTER 23: Understanding Basic Linux Security
Implementing Physical Security
Monitoring Your Systems
Auditing and Reviewing Linux
Summary
Exercises
CHAPTER 24: Understanding Advanced Linux Security
Implementing Linux Security with Cryptography
Implementing Linux Security with PAM
Summary
Exercises
CHAPTER 25: Enhancing Linux Security with SELinux
Understanding SELinux Benefits
Understanding How SELinux Works
Configuring SELinux
Monitoring and Troubleshooting SELinux
Putting It All Together
Obtaining More Information on SELinux
Summary
Exercises
CHAPTER 26: Securing Linux on a Network
Auditing Network Services
Working with Firewalls
Summary
Exercises
Part VI: Engaging with Cloud Computing
CHAPTER 27: Shifting to Clouds and Containers
Understanding Linux Containers
Starting with Linux Containers
Summary
Exercises
CHAPTER 28: Using Linux for Cloud Computing
Overview of Linux and Cloud Computing
Trying Basic Cloud Technology
Setting Up a Small Cloud
Summary
Exercises
CHAPTER 29: Deploying Linux to the Cloud
Getting Linux to Run in a Cloud
Creating Linux Images for Clouds
Using Amazon EC2 to Deploy Cloud Images
Summary
Exercises
CHAPTER 30: Automating Apps and Infrastructure with Ansible
Understanding Ansible
Exploring Ansible Components
Stepping Through an Ansible Deployment
Installing Ansible
Running Ad Hoc Ansible Commands
Automating Tasks with Ansible Tower Automation Framework
Summary
Exercises
CHAPTER 31: Deploying Applications as Containers with Kubernetes
Understanding Kubernetes
Trying Kubernetes
Enterprise‐Quality Kubernetes with EKS
Summary
Exercises
APPENDIX A: Media
Getting Fedora
Getting Red Hat Enterprise Linux
Getting Ubuntu
Booting Linux from a USB Drive
Creating Linux CDs and DVDs
APPENDIX B: Exercise Answers
Chapter 1: Starting with Linux
Chapter 2: Creating the Perfect Linux Desktop
Chapter 3: Using the Shell
Chapter 4: MovingAround the Filesystem
Chapter 5: Working with Text Files
Chapter 6: Managing Running Processes
Chapter 7: Writing Simple Shell Scripts
Chapter 8: Learning System Administration
Chapter 9: Installing Linux
Chapter 10: Getting and Managing Software
Chapter 11: Managing User Accounts
Chapter 12: Managing Disks and Filesystems
Chapter 13: Understanding Server Administration
Chapter 14: Administering Networking
Chapter 15: Starting and Stopping Services
Chapter 16: Configuring a Print Server
Chapter 17: Configuring a Web Server
Chapter 18: Configuring an FTP Server
Chapter 19: Configuring a Windows File Sharing (Samba) Server
Chapter 20: Configuring an NFS File Server
Chapter 21: Troubleshooting Linux
Chapter 22: Configuring an Artificial Intelligence Chat Bot
Chapter 23: Understanding Basic Linux Security
Chapter 24: Understanding Advanced Linux Security
Chapter 25: Enhancing Linux Security with SELinux
Chapter 26: Securing Linux on a Network
Chapter 27: Shifting to Clouds and Containers
Chapter 28: Using Linux for Cloud Computing
Chapter 29: Deploying Linux to the Cloud
Chapter 30: Automating Apps and Infrastructure with Ansible
Chapter 31: Deploying Applications as Containers with Kubernetes
Index
End User License Agreement
Chapter 3
TABLE 3.1 Keystrokes for Navigating Command Lines
TABLE 3.2 Keystrokes for Editing Command Lines
TABLE 3.3 Keystrokes for Cutting and Pasting Text from within Comma...
TABLE 3.4 Keystrokes for Using Command History
TABLE 3.5 Common Shell Environment Variables
TABLE 3.6 Bash Configuration Files
TABLE 3.7 Characters to Add Information to Bash Prompt
TABLE 3.8 Manual Page Sections
Chapter 4
TABLE 4.1 Commands to Create and Use Files
TABLE 4.2 Setting Read, Write, and Execute Permissions
Chapter 6
TABLE 6.1 Signals Available in Linux
Chapter 7
TABLE 7.1 Operators for Test Expressions
Chapter 9
TABLE 9.1 Boot Options for Disabling Features
TABLE 9.2 Boot Options for Video Problems
TABLE 9.3 Boot Options for VNC Installations
TABLE 9.4 Assigning Partitions to Particular Directories
Chapter 11
TABLE 11.1 Commands to Create and Use Files
Chapter 23
TABLE 23.1 Ideas for Good Passwords
TABLE 23.2
chage
Options
TABLE 23.3 Log Files in the
/var/log
Directory
TABLE 23.4 Viewing Log Files That Need Special Commands
TABLE 23.5 Package Verification Discrepancies
TABLE 23.6 Additional Filesystem Scans
TABLE 23.7 Popular Linux Intrusion Detection Systems
Chapter 24
TABLE 24.1 Cryptography Ciphers
TABLE 24.2 Linux Miscellaneous Cryptography Tools
TABLE 24.3 PAM Contexts
TABLE 24.4 PAM Configuration Control Flags and Response Handling
Chapter 25
TABLE 25.1
secon
Command Options
TABLE 25.2 File Security Context Label Management Commands+
TABLE 25.3 SELinux Policy Package Tools
Chapter 2
FIGURE 2.1 Starting with the GNOME desktop in Fedora.
FIGURE 2.2 Showing active apps, available apps, and workspaces on ...
FIGURE 2.3 Showing the list of available applications.
FIGURE 2.4 Right‐click to display an application icon's selection ...
FIGURE 2.5 As new desktops are used, additional ones appear on the...
FIGURE 2.6 Press Ctrl+Alt+Tab to display desktop areas to select....
FIGURE 2.7 Press Alt+Tab to select which running application to go...
FIGURE 2.8 Change desktop settings from the System Settings window...
FIGURE 2.9 Extensions add features to the GNOME desktop.
FIGURE 2.10 Change the Windows settings using the GNOME Tweak too...
FIGURE 2.11 Manage files and folders from the Nautilus window.
FIGURE 2.12 Access remote folders using the Nautilus Connect To S...
FIGURE 2.13 Download and install software from the huge Fedora re...
FIGURE 2.14 Play music, podcasts, and Internet radio from Rhythmb...
FIGURE 2.15 Rotate workspaces on a cube with the Desktop Cube ext...
FIGURE 2.16 Configure desktop effects in Compiz Settings Manager....
FIGURE 2.17 The wobble effect.
FIGURE 2.18 Visual Studio Code can integrate with the Copilot AI ...
FIGURE 2.19 Different elements in HTML content are highlighted in...
FIGURE 2.20 Display updated HTML content in your browser window....
Chapter 4
FIGURE 4.1 The Linux filesystem is organized as a hierarchy of dir...
Chapter 6
FIGURE 6.1 Displaying running processes with
top
FIGURE 6.2 Use the System Monitor window to view and change runnin...
FIGURE 6.3 Renice, kill, or pause a process from the System Monito...
Chapter 8
FIGURE 8.1 Logging in to Cockpit.
FIGURE 8.2 View system activity and other topics from the Cockpit ...
Chapter 9
FIGURE 9.1 Use Fedora Media Writer to make a bootable Linux on USB...
FIGURE 9.2 Step through the Fedora installation screen.
FIGURE 9.3 Choose from the Localization, Software, and System topi...
Chapter 10
FIGURE 10.1 Install and manage software packages from the Fedora ...
FIGURE 10.2 Install and manage snaps and other software from the ...
Chapter 11
FIGURE 11.1 Add and modify user accounts from Cockpit.
Chapter 12
FIGURE 12.1 LVM logical volumes can be mounted like regular parti...
FIGURE 12.2 View storage devices, filesystems, and activities fro...
FIGURE 12.3 View and change disk partitions for a select storage ...
FIGURE 12.4 Format the new storage device.
Chapter 13
FIGURE 13.1 Log in to Cockpit.
Chapter 14
FIGURE 14.1 Checking WIFI interfaces with GNOME Settings.
FIGURE 14.2 Viewing network security settings with the GNOME sett...
FIGURE 14.3 Viewing and changing network settings from Cockpit.
FIGURE 14.4 View services that are accessible through the firewal...
FIGURE 14.5 Changing network settings with GNOME Settings.
FIGURE 14.6 Setting up Firefox to use a proxy server.
FIGURE 14.7 Configuring networking with NetworkManager TUI.
FIGURE 14.8 Set static IP addresses by selecting Manual from the ...
Chapter 16
FIGURE 16.1 CUPS provides a web‐based administration tool.
FIGURE 16.2 You can do administration tasks from the Printers tab...
FIGURE 16.3 The Printer Properties window after adding a printer....
Chapter 17
FIGURE 17.1 Access Apache documentation directly from the local ...
FIGURE 17.2 Accessing an SSL website with a default certificate....
Chapter 18
FIGURE 18.1 Open access to your FTP service from the Firewall Con...
FIGURE 18.2 The gFTP FTP client lets you see both sides of an FTP...
Chapter 19
FIGURE 19.1 Identify a Samba share from the Nautilus Connect.
FIGURE 19.2 Add your Samba credentials.
FIGURE 19.3 Displaying a Samba share from Connect in Nautilus.
FIGURE 19.4 Accessing Samba shares from Windows.
Chapter 20
FIGURE 20.1 Use the Firewall Configuration window to open your fi...
FIGURE 20.2 View NFS shares mounted locally using the Cockpit web...
FIGURE 20.3 Add a new NFS mount using the Cockpit seb UI.
Chapter 21
FIGURE 21.1 Interrupt the GRUB bootloader to modify the boot proc...
FIGURE 21.2 Snippet from
systemd‐analyze
startup plot.
FIGURE 21.3 Monitor RAM and Swap usage in real time with Cockpit....
Chapter 24
FIGURE 24.1 The Fedora ISO security page tells how to get and che...
FIGURE 24.2 Basic asymmetric key cryptography.
FIGURE 24.3 Red Hat Enterprise Linux installation encryption opti...
FIGURE 24.4 Linux Fedora encryption symmetric key password.
FIGURE 24.5 Asking for the encryption symmetric key password at b...
Chapter 26
FIGURE 26.1
gufw
Firewall Configuration window.
FIGURE 26.2 Firewall Configuration window.
FIGURE 26.3 Firewall configuration.
Chapter 28
FIGURE 28.1 Start Virtual Machine Manager and check connection de...
FIGURE 28.2 Open the virtual machine and begin using it.
FIGURE 28.3 Choose which hypervisor to migrate the VM to.
Chapter 29
FIGURE 29.1 Cloning lets you save a permanent copy of a cloud ins...
FIGURE 29.2 Launch cloud instances using the Amazon EC2 Managemen...
FIGURE 29.3 Configure and launch an Amazon Linux 2023 instance on...
Chapter 31
FIGURE 31.1 Step through the Kubernetes project tutorials.
Appendix A
FIGURE A.1 Get Fedora ISO images from the Download Fedora Workstat...
FIGURE A.2 Get an Ubuntu ISO image from the Download Ubuntu Deskto...
FIGURE A.3 Use K3b to burn your Linux CDs or DVDs.
Cover
Table of Contents
Title Page
Copyright
Dedication
About the Authors
About the Technical Editor
Acknowledgement
Introduction
Begin Reading
APPENDIX A Media
APPENDIX B Exercise Answers
Index
End User License Agreement
iii
iv
v
vii
ix
xi
xxxv
xxxvi
xxxvii
xxxviii
xxxix
xl
xli
1
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
57
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
535
536
537
538
539
540
541
542
543
545
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
661
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
749
750
751
752
753
754
755
756
757
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
Eleventh Edition
Christopher Negus
Copyright © 2026 by John Wiley & Sons, Inc. All rights reserved, including rights for text and data mining and training of artificial intelligence technologies or similar technologies.
Published by John Wiley & Sons, Inc., Hoboken, New Jersey.
ISBNs: 9781394317462 (paperback), 9781394317486 (ePDF), 9781394317479 (ePub)
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per‐copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750‐8400, fax (978) 750‐4470, or on the web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748‐6011, fax (201) 748‐6008, or online at http://www.wiley.com/go/permission.
The manufacturer's authorized representative according to the EU General Product Safety Regulation is Wiley‐VCH GmbH, Boschstr. 12, 69469 Weinheim, Germany, e‐mail: [email protected].
Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and other countries and may not be used without written permission. Linux is a registered trademark of Linus Torvalds. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Further, readers should be aware that websites listed in this work may have changed or disappeared between when this work was written and when it is read. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages.
For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762‐2974, outside the United States at (317) 572‐3993 or fax (317) 572‐4002. For product technical support, you can find answers to frequently asked questions or reach us via live chat at https://support.wiley.com.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic formats. For more information about Wiley products, visit our web site at www.wiley.com.
Library of Congress Cataloging in Publication data available on request.
Cover image: © aleksandarvelasevic/Getty Images
As always, I dedicate this book to my wife, Sheree.
Chris Negus is a senior technical writer for Amazon Web Services (AWS). During his first few years with AWS, Chris worked on Linux container‐related open source software projects. He wrote the Production Environment page for the Kubernetes project, while serving on Kubernetes documentation release teams for versions 1.22, 1.23, and 1.24. For internal AWS open source projects, Chris wrote documentation for EKS Anywhere, EKS Distro, and Karpenter autoscaler.
More recently, Chris has worked on the AWS Elastic Kubernetes Service (EKS) documentation, where he has contributed to documentation for the EKS getting started experience, running AI/ML workloads on EKS, and EKS Auto Mode. He has also worked on docs for the Elastic Container Registry (ECR) and EKS Best Practices.
Before joining AWS, Chris was a Linux principal technical writer, instructor, and examiner for Red Hat, Inc. In more than a decade with Red Hat, Chris taught hundreds of IT professionals to become Red Hat Certified Engineers (RHCEs), and he wrote scores of documents on everything from Linux to virtualization to cloud computing and containerization.
Before joining Red Hat, Chris spent about a decade writing dozens of books on Linux and UNIX, including the Red Hat Linux Bible (all editions), Docker Containers, CentOS Bible, Fedora Bible, Linux Troubleshooting Bible, Linux Toys, Linux Toys II, and 10 editions of this Linux Bible. Chris also co‐authored several books for the Linux Toolbox series for power users: Fedora Linux Toolbox, SUSE Linux Toolbox, Ubuntu Linux Toolbox, Mac OS X Toolbox, and BSD UNIX Toolbox.
Before becoming an independent author, Chris worked for eight years with the organization at AT&T that developed the UNIX operating system before moving to Utah to help contribute to Novell's UnixWare project in the 1990s. When not writing about Linux, Chris enjoys playing soccer; hanging out with his wife, Sheree; and spending what time he can with his sons, Seth and Caleb, when he can find where they are.
David Clinton is a Linux server admin, AWS Solutions Architect, and data analyst who has worked with IT infrastructure in both academic and enterprise environments. He's administrated physical systems, containers, and networks using many Ubuntu flavors for nearly two decades. He has authored technology books—including AWS Certified Solutions Architect Study Guide: Associate SAA‐C03 Exam (Sybex, 2022)—and created nearly 100 video courses for Pluralsight that teach Linux administration, server virtualization, generative AI tools, and IT security.
In a previous life, David spent 20 years as a high school teacher. He currently lives in Toronto, Canada, with his wife and family and can be reached through his website: www.bootstrap-it.com.
First I want to acknowledge the people I work with every day at Amazon Web Services. I was lured away from my happy position at Red Hat with the promise of writing for open source containerization projects (mostly related to Kubernetes). While I have done a lot of work with those projects, lately I have focused on EKS and learning everything I can about running Kubernetes clusters at massive scale on the AWS cloud (where more Kubernetes clusters run than anywhere else in the world).
I couldn't ask for a better team to work with at AWS. My teammates Donovan Finch, Geoffrey Cline, and Paul Gasca have driven innovation to improve and extend the tools and processes needed for our work. Donovan's support background has made him a go‐to guy when I need a deep, technical understanding of a technology. Paul has created incredible tooling to make our jobs easier, including leading the charge into gathering our department's efforts into integrating AI in our work. Geoffrey has shown creative leadership in moving our work to be more open, helping to greatly extend the contributions to that work. Finally, our team is led by Samantha Lindsey‐Ahmed. Sam has been brave in personally and professionally supporting our team as we look for ways to break through boundaries, instead of waiting for others to solve our challenges.
As for the people at Wiley, thanks for letting me continue to develop and improve this book over the years. Thanks to Satish Gowrishankar for shepherding the long and arduous process of getting a writer to deliver an approximately 900‐page book from the writer's hands into production. Thanks to Danielle Shaw for a careful and thorough review of the text, and Kim Wimpsett for a nice final pass before the book entered production. Thanks to Saravanan Dakshinamurthy for keeping the page proofs on track. Thanks to David Clinton for his awesome technical review of the book (including making sure I cover Ubuntu properly). And thanks to Pete Gaughan and Kenyon Brown for overseeing the whole process.
Thanks also to Margot Maley Hutchison from Waterside Productions for contracting the book for me with Wiley and always looking out for my best interests for these many years. And special thanks to Jay Kipfmiller for mowing my lawn so I could finish this book.
Finally, thanks to my wife, Sheree, for sharing her life with me and doing such a great job raising Seth and Caleb.
—Christopher Negus
You can't learn Linux without using it.
I've come to that conclusion after more than 25 years of teaching people how to use Linux. You can't just read a book; you can't just listen to a lecture. You need someone to guide you, and you need to jump in and do it yourself.
In 1999, I wrote my first Linux book, Red Hat Linux Bible. The book's huge success gave me the opportunity to become a full‐time, independent Linux author. For about a decade, I wrote dozens of Linux books and explored the best ways to explain Linux from the quiet of my small home office.
In 2008, I hit the road. I was hired by Red Hat, Inc., as a full‐time instructor, teaching Linux to professional system administrators seeking Red Hat Certified Engineer (RHCE) certification. In my three years as a Linux instructor, I honed my teaching skills in front of a live audience whose Linux experience ranged from none to experienced professionals. Over time, I was able to broaden my own knowledge of Linux by acquiring about 10 certifications, including the Red Hat Certified Architect (RHCA) certification.
When I moved on to work for Amazon Web Services in 2020, I used my foundational knowledge of Linux to become a contributor to open source projects, primarily in the venue of containerization. Every day, I lean on my knowledge of Linux, both in the subject matter I cover and with the developer desktop I use to get my work done.
In previous editions of the Linux Bible, I turned my teaching experience into text to take a reader from someone who has never used Linux to someone with a wide range of skills needed to become a Linux professional. The skills you could acquire from previous editions remain in effect in this edition as well. They include the following:
Beginner to certified professional
: As long as you have used a computer, mouse, and keyboard, you can start with this book. I tell you how to get Linux, begin using it, step through critical topics, and ultimately excel at administering and securing it.
System administrator focused
: When you are finished with this book, you will know how to use Linux and how to modify and maintain it. Almost all of the topics needed to become a Red Hat Certified Engineer are introduced in this book. That said, many software developers have also used this book to understand how to work on a Linux system as a development platform or target for their applications.
Emphasis on command‐line tools
: Although point‐and‐click windows for managing Linux have improved greatly in recent years, many advanced features can be utilized only by entering commands and editing configuration files manually. I teach you how to become proficient with the Linux command‐line shell, and I occasionally compare shell features with graphical tools for accomplishing the same tasks.
Aimed at fewer Linux distributions
: In past editions, I described about 18 different Linux distributions. With only a few notable exceptions, most popular Linux distributions are either Red Hat based (Red Hat Enterprise Linux, Fedora, Oracle Linux, Amazon Linux, and so on) or Debian based (Ubuntu, Linux Mint, Kali Linux, and so forth). Although this book most thoroughly covers Red Hat distributions, I have continued to increase the coverage of Ubuntu throughout the book, because that's where many of the biggest Linux fans begin.
Many, many demos and exercises
: Instead of just telling you what Linux does, I actually show you what it does. Then, to make sure you got it, you have the opportunity to try Linux exercises yourself. Every procedure and exercise has been tested to work in Fedora or Red Hat Enterprise Linux. Most work in Ubuntu as well.
For this eleventh edition, major enhancements include a focus on developer desktop tools, using cloud consoles, updated firewall features, running AI workloads, and personal software installation tools:
Setting up a developer desktop
: Like many others, I like to use Linux as my developer desktop. To help you get started with that, I added a section describing developer tools that come with Linux. I also provided a brief introduction to Git, since it is the primary tool for storing, updating, and otherwise managing software in the open source world.
Using a cloud console
: On a local Linux system, you open a terminal window or access a virtual terminal to access a shell. For cloud‐based Linux systems, there are ways of accessing a Linux system shell from a cloud console. I describe how to do that for AWS.
Alternative software install tools
: While system‐wide software package installation has traditionally been handled by RPM and Deb tools for RHEL and Ubuntu, respectively, other tools have emerged for installing software for personal use. Descriptions of these tools, like Snap, Homebrew, and Flatpak, are added to this edition.
Improved firewall coverage
: With
iptables
firewalls becoming less common on Linux systems, I dropped most
iptables
coverage. Instead, I beefed up descriptions of
firewalld
(for RHEL and Fedora systems) and introduced UFW firewalls (for Ubuntu systems).
Setting up an AI chatbot
: With the availability of AI large language models (LLMs) and tools for managing those LLMs, it is possible to run your own AI chatbot. While this software is challenging to run on low‐powered hardware, I introduce you to how an AI chatbot can be run in Linux.
procs for listing processes
: I added a brief description of the
procs
utility for listing Linux processes.
Quick install
: I added a quick install section to the installation chapter for this edition. It should help someone starting with an old Windows laptop to get and install Fedora and overwrite their old operating system.
Web server deployment
: I added a short section on different ways to deploy a web server.
Using authselect to manage PAM
: In recent years, authselect has become the preferred way of managing pluggable authentication modules (PAM). So I enhanced descriptions of authselect.
Out with the old
: If there were a couple of popular ways to implement a particular feature, I would typically try to address both as long as they both were relevant. However, some features that I covered previously just became too outdated to include in this edition, so I just cut them. These include GNOME 2, iptables, and SystemV init. Cutting SystemV init was particularly sad for me because I was the first person to document it when it was created in the 1980s.
The book is organized to enable you to start off at the beginning with Linux and grow to become a professional Linux system administrator and power user.
Part I, “Getting Started,” includes two chapters designed to help you understand what Linux is and get you started with a Linux desktop:
Chapter 1
, “Starting with Linux,” covers topics such as what the Linux operating system is, where it comes from, and how to get started using it.
Chapter 2
, “Creating the Perfect Linux Desktop,” provides information on how you can create a desktop system and use some of the most popular desktop features.
Part II, “Becoming a Linux Power User,” provides in‐depth details on how to use the Linux shell, work with filesystems, manipulate text files, manage processes, and use shell scripts:
Chapter 3
, “Using the Shell,” includes information on how to access a shell, run commands, recall commands (using history), and do tab completion. The chapter also describes how to use variables, aliases, and man pages (traditional Linux command reference pages).
Chapter 4
, “Moving Around the Filesystem,” includes commands for listing, creating, copying, and moving files and directories. More advanced topics in this chapter include filesystem security, such as file ownership, permissions, and access control lists.
Chapter 5
, “Working with Text Files,” includes everything from basic text editors to tools for finding files and searching for text within files.
Chapter 6
, “Managing Running Processes,” describes how to see what processes are running on your system and change them. Ways of changing processes include killing, pausing, and sending other types of signals.
Chapter 7
, “Writing Simple Shell Scripts,” includes shell commands and functions that you can gather together into a file to run as a command itself.
In Part III, “Becoming a Linux System Administrator,” you learn how to administer Linux systems:
Chapter 8
, “Learning System Administration,” provides information on basic graphical tools, commands, and configuration files for administering Linux systems. It introduces the Cockpit web UI for simplified, centralized Linux administration.
Chapter 9
, “Installing Linux,” covers common installation tasks, such as disk partitioning and initial software package selection, as well as more advanced installation tools, such as installing from kickstart files.
Chapter 10
, “Getting and Managing Software,” provides an understanding of how software packages work and how to get and manage software packages.
Chapter 11
, “Managing User Accounts,” discusses tools for adding and deleting users and groups as well as how to centralize user account management.
Chapter 12
, “Managing Disks and Filesystems,” provides information on adding partitions, creating filesystems, and mounting filesystems, as well as working with logical volume management.
In Part IV, “Becoming a Linux Server Administrator,” you learn to create powerful network servers and the tools needed to manage them:
Chapter 13
, “Understanding Server Administration,” covers remote logging, monitoring tools, and the Linux boot process.
Chapter 14
, “Administering Networking,” discusses how to configure networking.
Chapter 15
, “Starting and Stopping Services,” provides information on starting and stopping services.
Chapter 16
, “Configuring a Print Server,” describes how to configure printers to use locally on your Linux system or over the network from other computers.
Chapter 17
, “Configuring a Web Server,” describes how to configure an Apache web server.
Chapter 18
, “Configuring an FTP Server,” covers procedures for setting up a vsftpd FTP server that can be used to enable others to download files from your Linux system over the network.
Chapter 19
, “Configuring a Windows File Sharing (Samba) Server,” covers Windows file server configuration with Samba.
Chapter 20
, “Configuring an NFS File Server,” describes how to use Network File System features to share folders of files among systems over a network.
Chapter 21
, “Troubleshooting Linux,” covers popular tools for troubleshooting your Linux system.
Chapter 22
, “Configuring an Artificial Intelligence Chatbot,” describes how to set up an AI chatbot using Ollama and language models of your choice.
In Part V, “Learning Linux Security Techniques,” you learn how to secure your Linux systems and services:
Chapter 23
, “Understanding Basic Linux Security,” covers basic security concepts and techniques.
Chapter 24
, “Understanding Advanced Linux Security,” provides information on using PAM and cryptology tools to tighten system security and authentication.
Chapter 25
, “Enhancing Linux Security with SELinux,” shows you how to enable Security Enhanced Linux (SELinux) to secure system services.
Chapter 26
, “Securing Linux on a Network,” covers network security features, such as
firewalld
and
ufw
firewalls, to secure system services.
In Part VI, “Engaging with Cloud Computing,” the book pivots from a single‐system focus toward containerization, cloud computing, and automation:
Chapter 27
, “Shifting to Clouds and Containers,” describes how to pull, push, start, stop, tag, and build container images.
Chapter 28
, “Using Linux for Cloud Computing,” introduces concepts of cloud computing in Linux by describing how to set up hypervisors, build virtual machines, and share resources across networks.
Chapter 29
, “Deploying Linux to the Cloud,” describes how to deploy Linux images to different cloud environments, including Amazon EC2 or a local Linux system that is configured for virtualization.
Chapter 30
, “Automating Apps and Infrastructure with Ansible,” tells you how to create Ansible playbooks and run ad hoc Ansible commands to automate the configuration of Linux systems and other devices.
Chapter 31
, “Deploying Applications as Containers with Kubernetes,” describes the Kubernetes project and how it is used to orchestrate container images, with the potential to massively scale up for large data centers.
Part VII contains two appendices to help you get the most from your exploration of Linux. Appendix A, “Media,” provides guidance on downloading Linux distributions. Appendix B, “Exercise Answers,” provides sample solutions to the exercises included in Chapters 2 through 31.
Throughout the book, special typography indicates code and commands. Commands and code are shown in a monospaced font:
This is how code looks.
In the event that an example includes both input and output, the monospaced font is still used, but input is presented in bold type to distinguish the two. Here's an example:
$
ftp ftp.handsonhistory.com
Name (home:jake):
jake
Password:
******
As for styles in the text:
New terms and important words appear in
italic
when introduced.
Keyboard strokes appear like this: Ctrl+A. This convention indicates to hold the Ctrl key as you also press the “a” key.
Filenames, URLs, and code within the text appear as follows:
persistence.properties
.
The following items call your attention to points that are particularly important.
A Note box provides extra information to which you need to pay special attention.
A Tip box shows a special way of performing a particular task.
A Caution box alerts you to take special care when executing a procedure or damage to your computer hardware or software could result.
If you are new to Linux, you might have vague ideas about what it is and where it came from. You may have heard something about it being free (as in cost) or free (as in freedom to use it as you please). Before you start putting your hands on Linux (which we will do soon enough), Chapter 1 seeks to answer some of your questions about the origins and features of Linux.
Take your time and work through this book to get up to speed on Linux and how you can make it work to meet your needs. This is your invitation to jump in and take the first step toward becoming a Linux expert!
To find links to various Linux distributions, tips on gaining Linux certification, and corrections to the book as they become available, go to www.wiley.com/go/linuxbible11e.
You can contact Christopher Negus at [email protected].
If you believe you have found a mistake in this book, please bring it to our attention. At John Wiley & Sons, we understand how important it is to provide our customers with accurate content, but even with our best efforts an error may occur.
To submit your possible errata, please email it to our Customer Service Team at [email protected] with the subject line “Possible Book Errata Submission.”
Chapter
1
Starting with Linux
Chapter
2
Creating the Perfect Linux Desktop
Learning what Linux is
Learning where Linux came from
Choosing Linux distributions
Exploring professional opportunities with Linux
Becoming certified in Linux
The operating systems war is over, and Linux has won. Proprietary operating systems simply cannot keep up with the pace of improvements and quality that Linux can achieve with its culture of sharing and innovation. Even Microsoft, whose former CEO Steve Ballmer once referred to Linux as “a cancer,” now says that Linux's use on its Microsoft's Azure cloud computing service has surpassed the use of Windows.
Linux is one of the most important technological advancements of the twenty‐first century. Beyond its impact on the growth of the Internet and its place as an enabling technology for a range of computer‐driven devices, Linux development has become a model for how collaborative projects can surpass what single individuals and companies can do alone.
Google runs thousands upon thousands of Linux servers to power its search technology. Its Android phones are based on Linux. Likewise, when you download and run Google's Chrome OS, you get a browser that is backed by a Linux operating system.
Facebook builds and deploys its site using what is referred to as a LAMP stack (Linux, Apache web server, MySQL database, and PHP web scripting language)—all open source projects. In fact, Facebook itself uses an open source development model, making source code for the applications and tools that drive Facebook available to the public. This model has helped Facebook shake out bugs quickly, get contributions from around the world, and fuel its exponential growth.
Financial organizations that have trillions of dollars riding on the speed and security of their operating systems also rely heavily on Linux. These include the New York Stock Exchange, Chicago Mercantile Exchange, and Tokyo Stock Exchange.
As cloud continues to be one of the hottest buzzwords today, a part of the cloud groundswell that isn't hype is that Linux and other open source technologies continue to be the foundation on which today's greatest cloud innovations are being built. Every software component that you need to build a private or public cloud (such as hypervisors, cloud controllers, network storage, virtual networking, and authentication) is freely available for you to start using from the open source world.
Today, the world's largest tech companies have gone all‐in on artificial intelligence (AI). Massive data center build‐outs are in progress to create and run new AI models, train and fine‐tune existing models, and add external data (with things like retrieval‐augmented generation). Cloud providers and others are making those services available to their customers at huge scale, while encouraging customers to engage with cloud AI services, such as ChatGPT, Google Gemini, Anthropic Claude, Microsoft Copilot, and Amazon Bedrock. Most operating systems running those huge AI workloads, by far, are Linux systems.
The widespread adoption of Linux around the world has created huge demand for Linux expertise. This chapter starts you down a path to becoming a Linux expert by helping you understand what Linux is, where it came from, and what your opportunities are for becoming proficient in it.
The rest of this book provides you with hands‐on activities to help you gain that expertise. Finally, I show you how to apply that expertise to cloud technologies, including automation tools, such as Ansible, and containerization orchestration technologies, such as Kubernetes and OpenShift.
Linux is a computer operating system. An operating system consists of the software that manages your computer and lets you run applications on it. The features that make up Linux and similar computer operating systems include the following:
Detecting and preparing hardware
:
When the Linux system boots up (when you turn on your computer), it looks at the components on your computer (processors, hard drive, network cards, and so on) and loads the software (drivers and modules) needed to access those particular hardware devices.
Managing processes
:
The operating system must keep track of multiple processes running at the same time and decide which have access to the central processing units (CPUs) and when. The system also must offer ways of starting, stopping, and changing the status of processes.
Managing memory
:
Random access memory (RAM) and swap space (extended memory) must be allocated to applications as they need memory. The operating system decides how requests for memory are handled.
Providing user interfaces
: An operating system must provide ways of accessing the system. The first Linux systems were accessed from a command‐line interpreter called a
shell
. Today, graphical desktop interfaces are commonly available as well.
Controlling filesystems
:
Filesystem structures are built into the operating system (or loaded as modules). The operating system controls ownership and access to the files and directories (folders) that the filesystems contain.
Providing user access and authentication
:
Creating user accounts and allowing boundaries to be set between users is a basic feature of Linux. Separate user and group accounts enable users to control their own files and processes.
Offering administrative utilities
: In Linux, hundreds (perhaps thousands) of commands and graphical windows are available to do such things as add users, manage disks, monitor the network, install software, and generally secure and manage your computer. Web UI tools, such as Cockpit, have lowered the bar for doing complex administrative tasks.
Starting up services
:
To use printers, handle log messages, and provide a variety of system and network services, processes called
daemon processes
run in the background, waiting for requests to come in. Many types of services run in Linux. Linux provides different ways of starting and stopping these services. In other words, while Linux includes web browsers to view web pages, it can also be the computer that serves up web pages to others. Popular server features include web, mail, database, printer, file, DNS, and DHCP servers.
Programming tools
:
A wide variety of programming utilities for creating applications and libraries for implementing specialty interfaces are available with Linux.
As someone managing Linux systems, you need to learn how to work with those features just described. While many features can be managed using graphical interfaces, an understanding of the shell command line is critical for someone administering Linux systems.
Modern Linux systems now go way beyond what the first UNIX systems (on which Linux was based) could do. Advanced features in Linux, often used in large enterprises, include the following:
Clustering
: Linux can be configured to work in clusters so that multiple systems can appear as one larger set of compute resources to the outside world. Customer requests for services from the cluster can be distributed between instances of those services running on multiple nodes, making access to those services continue seamlessly, even if any single service or node becomes unavailable.
Virtualization
:
To manage computing resources more efficiently, Linux can run as a virtualization host. On that host, you could run other Linux systems, Microsoft Windows, BSD, or other operating systems as virtual guests. To the outside world, each of those virtual guests appears as a separate computer. KVM and Xen are two technologies in Linux for creating virtual hosts.
Cloud computing
:
To manage large‐scale virtualization environments, you can use full‐blown cloud computing platforms based primarily on Linux. Clouds such as Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure can simultaneously manage many virtualization hosts, virtual networks, user and system authentication methods, virtual guests, and networked storage. Clouds even allow you to create your own virtual private clouds (VPCs) so you can fully control the security policies and performance of the environment in which your workloads run. Projects such as Kubernetes, which manages containerized applications, are made to scale your compute resources up and down as the demands of your workloads change.
Real‐time computing
:
Linux can be configured for real‐time computing, where high‐priority processes can expect fast, predictable attention.
Specialized storage
:
Instead of just storing data on the computer's hard disk, you can store it on many specialized local and networked storage interfaces that are available in Linux. Popular file‐level storage choices in Linux include Network File System (NFS) and Samba. Supported block‐level network storage in Linux includes iSCSI, Fibre Channel, and Infiniband. Entire open source storage platforms include projects such as Ceph (
https://ceph.io
) and GlusterFS (
https://www.gluster.org
).
Some of these advanced topics are not covered in this book. However, the features covered here for using the shell, working with disks, starting and stopping services, and configuring a variety of servers should serve as a foundation for working with those advanced features.
If you are new to Linux, chances are good that you have used a Microsoft Windows or macOS operating system. Although macOS had its roots in a free software operating system, referred to as the Berkeley Software Distribution (more on that later), operating systems from both Microsoft and Apple are considered proprietary operating systems. What that means is the following:
You cannot see the code used to create the operating system, and therefore, you cannot change the operating system at its most basic levels if it doesn't suit your needs. Also, you can't use the operating system to build your own operating system from source code.
You cannot check the code to find bugs, explore security vulnerabilities, or simply learn what that code is doing.
You may not be able to plug your own software easily into the operating system if the creators of that system don't want to expose the programming interfaces you need to the outside world.
You might look at those statements about proprietary software and say, “What do I care? I'm not a software developer. I don't want to see or change how my operating system is built.”
That may be true. However, the fact that others can take free and open source software and use it as they please has driven the explosive growth of the Internet (think Google), mobile phones (think Android), special computing devices (think automotive infotainment systems and software‐defined vehicles), and hundreds of technology companies. Free software has driven down computing costs and allowed for an explosion of innovation.
Maybe you don't want to use Linux—as Google, Facebook, and other companies have done—to build the foundation for a multibillion‐dollar company. Nonetheless, those companies and others who now rely on Linux to drive their computer infrastructures need more and more people with the skills to run those systems and deploy workloads on them.
