40,99 €
The bestselling study guide for the popular Linux Professional Institute Certification Level 1 (LPIC-1). The updated fifth edition of LPIC-1: Linux Professional Institute Certification Study Guide is a comprehensive, one-volume resource that covers 100% of all exam objectives. Building on the proven Sybex Study Guide approach, this essential resource offers a comprehensive suite of study and learning tools such as assessment tests, hands-on exercises, chapter review questions, and practical, real-world examples. This book, completely updated to reflect the latest 101-500 and 102-500 exams, contains clear, concise, and user-friendly information on all of the Linux administration topics you will encounter on test day. Key exam topics include system architecture, Linux installation and package management, GNU and UNIX commands, user interfaces and desktops, essential system services, network and server security, and many more. Linux Servers currently have a 20% market share which continues to grow. The Linux OS market saw a 75% increase from last year and is the third leading OS, behind Windows and MacOS. There has never been a better time to expand your skills, broaden your knowledge, and earn certification from the Linux Professional Institute. A must-have guide for anyone preparing for the 101-500 and 102-500 exams, this study guide enables you to: * Assess your performance on practice exams to determine what areas need extra study * Understand and retain vital exam topics such as administrative tasks, network configuration, booting Linux, working with filesystems, writing scripts, and using databases * Gain insights and tips from two of the industry's most highly respected instructors, consultants, and authors * Access Sybex interactive tools that include electronic flashcards, an online test bank, customizable practice exams, bonus chapter review questions, and a searchable PDF glossary of key terms LPIC-1: Linux Professional Institute Certification Study Guide is ideal for network and system administrators studying for the LPIC-1 exams, either for the first time or for the purpose of renewing their certifications.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 1045
Veröffentlichungsjahr: 2019
Fifth Edition
Christine Bresnahan
Richard Blum
Copyright © 2020 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-119-58212-0 ISBN: 978-1-119-58209-0 (ebk.)ISBN: 978-1-119-58208-3 (ebk.)
Manufactured in the United States of America
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 Sections 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, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. 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/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2019950102
TRADEMARKS: Wiley, the Wiley logo, and the Sybex 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. LPIC-1 is a registered trademark of Linux Professional Institute, Inc. 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.
First, all glory and praise go to God, who through His Son, Jesus Christ, makes all things possible, and gives us the gift of eternal life.
Many thanks go to the fantastic team of people at Sybex for their outstanding work on this project. Thanks to Kenyon Brown, the senior acquisitions editor, for offering us the opportunity to work on this book. Also thanks to Stephanie Barton, the development editor, for keeping things on track and making the book more presentable. Thanks Steph, for all your hard work and diligence. The technical editor, David Clinton, did a wonderful job of double-checking all of the work in the book in addition to making suggestions to improve the content. Thanks also goes to the young and talented Daniel Anez (theanez.com) for his illustration work. We would also like to thank Carole Jelen at Waterside Productions, Inc., for arranging this opportunity for us and for helping us out in our writing careers.
Christine would particularly like to thank her husband, Timothy, for his encouragement, patience, and willingness to listen, even when he has no idea what she is talking about. Christine would also like to express her love for Samantha and Cameron, “May God bless your marriage richly.”
Rich would particularly like to thank his wife, Barbara, for enduring his grouchy attitude during this project, and helping to keep up his spirits with baked goods.
Christine Bresnahan, CompTIA Linux+, started working with computers more than 30 years ago in the IT industry as a systems administrator. Christine is an adjunct professor at Ivy Tech Community College where she teaches Linux certification and Python programming classes. She also writes books and produces instructional resources for the classroom.
Richard Blum, CompTIA Linux+ ce, CompTIA Security+ ce, has also worked in the IT industry for more than 30 years as both a system and network administrator, and he has published numerous Linux and open source books. Rich is an online instructor for Linux and web programming courses that are used by colleges and universities across the United States. When he is not being a computer nerd, Rich enjoys spending time with his wife Barbara and his two daughters, Katie and Jessica.
Cover
Acknowledgments
About the Authors
Table of Exercises
Introduction
Assessment Test
Answers to Assessment Test
Part I Exam 101-500
Chapter 1 Exploring Linux Command-Line Tools
Understanding Command-Line Basics
Editing Text Files
Processing Text Using Filters
Using Regular Expressions
Using Streams, Redirection, and Pipes
Summary
Exam Essentials
Review Questions
Chapter 2 Managing Software and Processes
Looking at Package Concepts
Using RPM
Using Debian Packages
Managing Shared Libraries
Managing Processes
Summary
Exam Essentials
Review Questions
Chapter 3 Configuring Hardware
Configuring the Firmware and Core Hardware
Storage Basics
Storage Alternatives
Partitioning Tools
Understanding Filesystems
Formatting Filesystems
Mounting Filesystems
Managing Filesystems
Summary
Exam Essentials
Review Questions
Chapter 4 Managing Files
Using File Management Commands
Managing File Ownership
Controlling Access to Files
Locating Files
Summary
Exam Essentials
Review Questions
Chapter 5 Booting, Initializing, and Virtualizing Linux
Understanding the Boot Process
Looking at Firmware
Looking at Boot Loaders
The Initialization Process
Using the systemd Initialization Process
Using the SysV Initialization Process
Stopping the System
Notifying the Users
Virtualizing Linux
Summary
Exam Essentials
Review Questions
Part II Exam 102-500
Chapter 6 Configuring the GUI, Localization, and Printing
Understanding the GUI
Understanding the X11 Architecture
Managing the GUI
Providing Accessibility
Using X11 for Remote Access
Using Remote Desktop Software
Understanding Localization
Setting Your Locale
Looking at Time
Configuring Printing
Summary
Exam Essentials
Review Questions
Chapter 7 Administering the System
Managing Users and Groups
Managing Email
Using Log and Journal Files
Maintaining the System Time
Summary
Exam Essentials
Review Questions
Chapter 8 Configuring Basic Networking
Networking Basics
Configuring Network Features
Basic Network Troubleshooting
Advanced Network Troubleshooting
Summary
Exam Essentials
Review Questions
Chapter 9 Writing Scripts
Shell Variables
The Basics of Shell Scripting
Advanced Shell Scripting
Writing Script Programs
Running Scripts in Background Mode
Running Scripts Without a Console
Sending Signals
Job Control
Running Like Clockwork
Summary
Exam Essentials
Review Questions
Chapter 10 Securing Your System
Administering Network Security
Administering Local Security
Exploring Cryptography Concepts
Looking at SSH
Using GPG
Summary
Exam Essentials
Review Questions
Appendix Answers to Review Questions
Chapter 1: Exploring Linux Command-Line Tools
Chapter 2: Managing Software and Processes
Chapter 3: Configuring Hardware
Chapter 4: Managing Files
Chapter 5: Booting, Initializing, and Virtualizing Linux
Chapter 6: Configuring the GUI, Localization, and Printing
Chapter 7: Administering the System
Chapter 8: Configuring Basic Networking
Chapter 9: Writing Scripts
Chapter 10: Securing Your System
Index
Advert
End User License Agreement
Chapter 1
Table 1.1
Table 1.2
Table 1.3
Table 1.4
Table 1.5
Table 1.6
Table 1.7
Table 1.8
Table 1.9
Table 1.10
Table 1.11
Table 1.12
Chapter 2
Table 2.1
Table 2.2
Table 2.3
Table 2.4
Table 2.5
Table 2.6
Table 2.7
Table 2.8
Table 2.9
Table 2.10
Table 2.11
Table 2.12
Chapter 3
Table 3.1
Table 3.2
Table 3.3
Table 3.4
Table 3.5
Table 3.6
Chapter 4
Table 4.1
Table 4.2
Table 4.3
Table 4.4
Table 4.5
Table 4.6
Table 4.7
Table 4.8
Table 4.9
Table 4.10
Table 4.11
Table 4.12
Table 4.13
Table 4.14
Table 4.15
Table 4.16
Table 4.17
Table 4.18
Chapter 5
Table 5.1
Table 5.2
Table 5.3
Table 5.4
Table 5.5
Table 5.6
Table 5.7
Table 5.8
Table 5.9
Table 5.10
Table 5.11
Table 5.12
Table 5.13
Table 5.14
Chapter 6
Table 6.1
Table 6.2
Table 6.3
Table 6.4
Table 6.5
Table 6.6
Table 6.7
Table 6.8
Chapter 7
Table 7.1
Table 7.2
Table 7.3
Table 7.4
Table 7.5
Table 7.6
Table 7.7
Table 7.8
Table 7.9
Table 7.10
Table 7.11
Table 7.12
Table 7.13
Table 7.14
Chapter 8
Table 8.1
Table 8.2
Table 8.3
Table 8.4
Chapter 9
Table 9.1
Table 9.2
Chapter 10
Table 10.1
Table 10.2
Table 10.3
Chapter 1
Figure 1.1 Using the
nano
text editor
Figure 1.2 Using the
emacs
text editor
Figure 1.3 Using the
vim
text editor
Figure 1.4 Using the
less
text pager
Chapter 2
Figure 2.1 Using the
dpkg-reconfigure
utility
Figure 2.2 The output of the
top
command
Figure 2.3 The
screen
command’s “welcome” display
Figure 2.4 A three-focus monitoring window using the
screen
utility
Figure 2.5 The
tmux new
command’s first window
Figure 2.6 A three-pane monitoring window using the
tmux
utility
Chapter 3
Figure 3.1 The Linux LVM layout
Figure 3.2 The GParted interface
Figure 3.3 The Linux virtual directory structure divided between two drives
Chapter 4
Figure 4.1 Hard link file relationship
Figure 4.2 Soft link file relationship
Figure 4.3 File permissions as displayed by the
ls -l
command
Chapter 5
Figure 5.1 An Ubuntu GRUB2 menu
Figure 5.2 Editing an Ubuntu GRUB2 menu entry
Figure 5.3 Issuing the
wall
command
Figure 5.4 Receiving
wall
command output
Figure 5.5 A Type 2 hypervisor example
Figure 5.6 A Type 1 hypervisor example
Figure 5.7 A container example
Chapter 6
Figure 6.1 Serving the GUI components
Figure 6.2 The Ubuntu display manager login screen
Figure 6.3 The GNOME Shell desktop environment
Figure 6.4 The KDE Plasma desktop environment
Figure 6.5 The Cinnamon desktop environment
Figure 6.6 The MATE desktop environment
Figure 6.7 The Xfce desktop used in the XUbuntu Linux distribution
Figure 6.8 Universal access top panel menu in GNOME Shell
Figure 6.9 Forwarding X11
Figure 6.10 Using TigerVNC
Figure 6.11 Using Xrdp
Figure 6.12 The language option in a CentOS installation
Figure 6.13 The CUPS main web page
Chapter 7
Figure 7.1 The process of adding a user account
Figure 7.2 The Linux modular email environment
Figure 7.3 The NTP protocol clock stratum
Chapter 8
Figure 8.1 A wired office network infrastructure
Figure 8.2 A wireless network infrastructure
Figure 8.3 Network addressing on a local network
Figure 8.4 Network Manager showing a wireless network connection
Figure 8.5 The Network Manager edit configurations window
Figure 8.6 The Network Manager
nmtui
command-line tool
Chapter 10
Figure 10.1 Asymmetric encryption example
Figure 10.2 Forwarding X11
Cover
Table of Contents
Introduction
iii
iv
v
vii
xix
xxi
xxii
xxiii
xxiv
xxv
xxvi
xxvii
xxviii
xxix
xxx
xxxi
xxxii
xxxiii
xxxiv
xxxv
xxxvi
xxxvii
xxxviii
xxxix
xl
xli
xlii
xliii
xliv
xlv
xlvi
xlvii
xlviii
xlix
1
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
56
57
58
59
60
61
62
63
64
65
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
164
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
270
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
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
438
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
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
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
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
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
578
579
580
581
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
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
Exercise 8.1 Determining the Network Environment
Exercise 9.1 Writing a Bash Script to View the Password Information for System Users
Linux has become one of the fastest-growing operating systems used in server environments. Most companies utilize some type of Linux system within their infrastructure, and Linux is one of the major players in the cloud computing world. The ability to build and manage Linux systems is a skill that many companies are now looking for. The more you know about Linux, the more marketable you’ll become in today’s computer industry.
The Linux Professional Institute (LPI) has developed a series of certifications to help guide you through a career in the Linux world. Its LPIC-1 certification is an introductory certification for people who want to enter careers involving Linux. The exam is meant to certify that you have the skills necessary to install, operate, and troubleshoot a Linux system and are familiar with Linux-specific concepts and basic hardware.
The purpose of this book is to help you pass the LPIC-1 exams (101 and 102), updated in 2019 to version 5 (commonly called 101-500 and 102-500). Because these exams cover basic Linux installation, configuration, maintenance, applications, networking, and security, those are the topics that are emphasized in this book. You’ll learn enough to get a Linux system up and running and to configure it for many common tasks. Even after you’ve taken and passed the LPIC-1 exams, this book should remain a useful reference.
With the growing popularity of Linux (and the increase in Linux-related jobs) comes hype. With all the hype that surrounds Linux, it’s become hard for employers to distinguish employees who are competent Linux administrators from those who just know the buzzwords. This is where the LPIC-1 certification comes in.
With an LPIC-1 certification, you will establish yourself as a Linux administrator who is familiar with the Linux platform and can install, maintain, and troubleshoot any type of Linux system. LPI has created the LPIC-1 exams as a way for employers to have confidence in knowing their employees who pass the exam will have the skills necessary to get the job done.
The certification is available to anyone who passes the two required exams: 101 and 102. The current versions of the exams are version 5 and are denoted as 101-500 and 102-500.
The exam is administered by Pearson VUE. The exam can be taken at any Pearson VUE testing center. If you pass, you will get a certificate in the mail saying that you have passed. Contact (877) 619-2096 for Pearson VUE contact information.
To register for the exam with Pearson VUE, call (877) 619-2096 or register online at www.vue.com. However you do it, you’ll be asked for your name, mailing address, phone number, employer, when and where you want to take the test (i.e., which testing center), and your credit card number (arrangement for payment must be made at the time of registration).
Anyone who wants to pass the LPIC-1 certification exams would benefit from this book, but that’s not the only reason for purchasing the book. This book covers all of the material someone new to the Linux world would need to know to start out in Linux. After you’ve become familiar with the basics of Linux, the book will serve as an excellent reference book for quickly finding answers to your everyday Linux questions.
The book is written with the assumption that you have a familiarity with basic computer and networking principles. Although no experience with Linux is required in order to benefit from this book, it will help if you know your way around a computer in either the Windows or macOS world, such as how to use a keyboard, use optical disks, and work with USB thumb drives.
It will also help to have a Linux system available to follow along with. Each chapter contains a simple exercise that will walk you through the basic concepts presented in the chapter. This provides the crucial hands-on experience that you’ll need, both to pass the exam and to do well in the Linux world.
While the LPI LPIC-1 exams are Linux distribution neutral, it’s impossible to write exercises that work in all Linux distributions. That said, the exercises in this book assume you have either Ubuntu 18.04 LTS or CentOS 7 available. You can install either or both of these Linux distributions in a virtual environment using the Oracle VirtualBox software, available at https://virtualbox.org.
This book consists of 10 chapters plus supplementary information: an online glossary, this introduction, and the assessment test after the introduction. The chapters are organized as follows:
Chapter 1, “Exploring Linux Command-Line Tools,” covers the basic tools you need to interact with Linux. These include shells, redirection, pipes, text filters, and regular expressions.
Chapter 2, “Managing Software and Processes,” describes the programs you’ll use to manage software. Much of this task is centered around the RPM and Debian package management systems. The chapter also covers handling shared libraries and managing processes (that is, running programs).
Chapter 3, “Configuring Hardware,” focuses on Linux’s interactions with the hardware on which it runs. Specific hardware and procedures for using it include the BIOS, expansion cards, USB devices, hard disks, and partitions and filesystems used on hard disks.
Chapter 4, “Managing Files,” covers the tools used to manage files. This includes commands to manage files, ownership, and permissions, as well as Linux’s standard directory tree and tools for archiving files.
Chapter 5, “Booting, Initializing, and Virtualizing Linux,” explains how Linux boots up and how you can edit files in Linux. Specific topics include the GRUB Legacy and GRUB 2 boot loaders, boot diagnostics, and runlevels. It also takes a look at how to run Linux in a virtual machine environment.
Chapter 6, “Configuring the GUI, Localization, and Printing,” describes the Linux GUI and printing subsystems. Topics include X configuration, managing GUI logins, configuring location-specific features, enabling accessibility features, and setting up Linux to use a printer.
Chapter 7, “Administering the System,” describes miscellaneous administrative tasks. These include user and group management, tuning user environments, managing log files, and setting the clock.
Chapter 8, “Configuring Basic Networking,” focuses on basic network configuration. Topics include TCP/IP basics, setting up Linux on a TCP/IP network, and network diagnostics.
Chapter 9, “Writing Scripts,” covers how to automate simple tasks in Linux. Scripts are small programs that administrators often use to help automate common tasks. Being able to build simple scripts and have them run automatically at specified times can greatly simplify your administrator job.
Chapter 10, “Securing Your System,” covers security. Specific subjects include network security, local security, and the use of encryption to improve security.
Chapters 1 through 5 cover the 101-500 exam, and Chapters 6 through 10 cover the 102-500 exam. These make up Part I and Part II of the book, respectively.
Each chapter begins with a list of the exam objectives that are covered in that chapter. The book doesn’t cover the objectives in order. Thus, you shouldn’t be alarmed at some of the odd ordering of the objectives within the book. At the end of each chapter, you’ll find a couple of elements you can use to prepare for the exam:
Exam Essentials This section summarizes important information that was covered in the chapter. You should be able to perform each of the tasks or convey the information requested.
Review Questions Each chapter concludes with 20 review questions. You should answer these questions and check your answers against the ones provided after the questions. If you can’t answer at least 80 percent of these questions correctly, go back and review the chapter or at least those sections that seem to be giving you difficulty.
The review questions, assessment test, and other testing elements included in this book are not derived from the actual exam questions, so don’t memorize the answers to these questions and assume that doing so will enable you to pass the exam. You should learn the underlying topic, as described in the text of the book. This will let you answer the questions provided with this book and pass the exam. Learning the underlying topic is also the approach that will serve you best in the workplace—the ultimate goal of a certification.
To get the most out of this book, you should read each chapter from start to finish and then check your memory and understanding with the chapter-end elements. Even if you’re already familiar with a topic, you should skim the chapter; Linux is complex enough that there are often multiple ways to accomplish a task, so you may learn something even if you’re already competent in an area.
Readers of this book can access a website that contains several additional study tools, including the following:
Readers can access these tools by visiting www.sybex.com/go/lpic5e.
Sample Tests All of the questions in this book will be included, along with the assessment test at the end of this introduction and the 200 questions from the review sections at the end of each chapter. In addition, there are two 50-question bonus exams. The test engine runs on Windows, Linux, and macOS.
Electronic Flashcards The additional study tools include 150 questions in flashcard format (a question followed by a single correct answer). You can use these to review your knowledge of the exam objectives. The flashcards run on both Windows and Linux.
Glossary of Terms as a PDF File In addition, there is a searchable glossary in PDF format, which can be read on all platforms that support PDF.
This book uses certain typographic styles in order to help you quickly identify important information and to avoid confusion over the meaning of words such as on-screen prompts. In particular, look for the following styles:
Italicized text
indicates key terms that are described at length for the first time in a chapter. (Italics are also used for emphasis.)
A monospaced font
indicates the contents of configuration files, messages displayed at a text-mode Linux shell prompt, filenames, text-mode command names, and Internet URLs.
Italicized monospaced text
indicates a variable—information that differs from one system or command run to another, such as the name of a client computer or a process ID number.
Bold monospaced text
is information that you’re to type into the computer, usually at a Linux shell prompt. This text can also be italicized to indicate that you should substitute an appropriate value for your system. (When isolated on their own lines, commands are preceded by non-bold monospaced
$
or
#
command prompts, denoting regular user or system administrator use, respectively.)
In addition to these text conventions, which can apply to individual words or entire paragraphs, a few conventions highlight segments of text:
A note indicates information that’s useful or interesting but that’s somewhat peripheral to the main text. A note might be relevant to a small number of networks, for instance, or it may refer to an outdated feature.
A tip provides information that can save you time or frustration and that may not be entirely obvious. A tip might describe how to get around a limitation or how to use a feature to perform an unusual task.
Warnings describe potential pitfalls or dangers. If you fail to heed a warning, you may end up spending a lot of time recovering from a bug, or you may even end up restoring your entire system from scratch.
An exercise is a procedure you should try on your own computer to help you learn about the material in the chapter. Don’t limit yourself to the procedures described in the exercises, though! Try other commands and procedures to really learn about Linux.
A real-world scenario is a type of sidebar that describes a task or example that’s particularly grounded in the real world. This may be a situation we or somebody we know has encountered, or it may be advice on how to work around problems that are common in real, working Linux environments.
Behind every computer industry exam you can be sure to find exam objectives—the broad topics in which exam developers want to ensure your competency. The official exam objectives are listed here. (They’re also printed at the start of the chapters in which they’re covered.)
Exam objectives are subject to change at any time without prior notice and at LPI’s sole discretion. Please visit LPI’s website (www.lpi.org) for the most current listing of exam objectives.
The following are the areas in which you must be proficient in order to pass the 101-500 exam. This exam is broken into four topics (101–104), each of which has three to eight objectives. Each objective has an associated weight, which reflects its importance to the exam as a whole. Refer to the LPI website to view the weights associated with each objective. The four main topics are:
Subject Area
101 System Architecture
102 Linux Installation and Package Management
103 GNU and Unix Commands
104 Devices, Linux Filesystems, Filesystem Hierarchy Standard
Enable and disable integrated peripherals.
Differentiate between the various types of mass storage devices.
Determine hardware resources for devices.
Tools and utilities to list various hardware information (e.g.,
lsusb
,
lspci
, etc.).
Tools and utilities to manipulate USB devices.
Conceptual understanding of
sysfs
,
udev
,
hald
,
dbus.
The following is a partial list of the used files, terms, and utilities:
/sys
,
/proc
,
/dev
,
modprobe
,
lsmod
,
lspci
,
lsusb
.
Provide common commands to the boot loader and options to the kernel at boot time.
Demonstrate knowledge of the boot sequence from BIOS/UEFI to boot completion.
Understanding of SysVinit and system.
Awareness of Upstart.
Check boot events in the log file.
The following is a partial list of the used files, terms and utilities:
dmesg
,
journalctl
, BIOS, UEFI, bootloader, kernel,
init, initramfs
, SysVinit, systemd.
Set the default run level or boot target.
Change between run levels/boot targets including single user mode.
Shutdown and reboot from the command line.
Alert users before switching run levels/boot targets or other major system events.
Properly terminate processes.
Awareness of
acpid
.
The following is a partial list of the used files, terms and utilities:
/etc/inittab
,
shutdown
,
init
,
/etc/init.d
,
telinit
,
systemd
,
systemctl
,
/etc/systemd/
,
/usr/lib/system/
,
wall
.
Allocate filesystems and swap space to separate partitions or disks.
Tailor the design to the intended use of the system.
Ensure the
/boot
partition conforms to the hardware architecture requirements for booting.
Knowledge of basic features of LVM.
The following is a partial list of the used files, terms and utilities:
/
(root) filesystem,
/var
filesystem,
/home
filesystem,
/boot
filesystem, swap space, mount points, partitions, EFI System Partition (ESP).
Providing alternative boot locations and backup boot options.
Install and configure a boot loader such as GRUB Legacy.
Perform basic configuration changes for GRUB 2.
Interact with the boot loader.
The following is a partial list of the used files, terms, and utilities:
/boot/grub/menu .lst
,
grub.cfg
and
grub.conf
,
grub-install
,
grub-mkconfig
, MBR.
Identify shared libraries.
Identify the typical locations of system libraries.
Load shared libraries.
The following is a partial list of the used files, terms, and utilities:
ldd
,
ldconfig
,
/etc/ld.so.conf
,
LD_LIBRARY_PATH.
Install, upgrade and uninstall Debian binary packages.
Find packages containing specific files or libraries which may or may not be installed.
Obtain package information like version, content, dependencies, package integrity and installation status (whether or not the package is installed).
Awareness of apt.
The following is a partial list of the used files, terms, and utilities:
/etc/apt/sources .list
,
dpkg
,
dpkg-reconfigure
,
apt-get
,
apt-cache
.
Install, re-install, upgrade and remove packages using RPM, YUM, and Zypper.
Obtain information on RPM packages such as version, status, dependencies, integrity and signatures.
Determine what files a package provides, as well as find which package a specific file comes from.
The following is a partial list of the used files, terms, and utilities:
rpm
,
rpm2cpio
,
/etc/yum.conf
,
/etc/yum.repos.d/
,
yum
,
zypper
.
Understand the general concept of virtual machines and containers.
Understand common elements virtual machines in an IaaS cloud, such as computing instances, block storage and networking.
Understand unique properties of a Linux system which have to changed when a system is cloned or used as a template.
Understand how system images are used to deploy virtual machines, cloud instances and containers.
Understand Linux extensions which integrate Linux with a virtualization product.
Awareness of cloud-init.
The following is a partial list of the used files, terms, and utilities: Virtual machine, Linux container, Application container, Guest drivers, SSH host keys, D-Bus machine ID.
Use single shell commands and one-line command sequences to perform basic tasks on the command line.
Use and modify the shell environment including defining, referencing and exporting environment variables.
Use and edit command history.
Invoke commands inside and outside the defined path.
The following is a partial list of the used files, terms, and utilities:
bash
,
echo
,
env
,
export
,
pwd
,
set
,
unset
,
type
,
which
,
man
,
uname
,
history
,
.bash_history
, Quoting.
Send text files and output streams through text utility filters to modify the output using standard UNIX commands found in the GNU
textutils
package.
The following is a partial list of the used files, terms, and utilities:
bzcat
,
cat
,
cut
,
head
,
less
,
md5sum
,
nl
,
od
,
paste
,
sed
,
sha256sum
,
sha512sum
,
sort
,
split
,
tail
,
tr
,
uniq
,
wc
,
xzcat
,
zcat
.
Copy, move and remove files and directories individually.
Copy multiple files and directories recursively.
Remove files and directories recursively.
Use simple and advanced wildcard specifications in commands.
Using
find
to locate and act on files based on type, size, or time.
Usage of
tar
,
cpio
, and
dd.
The following is a partial list of the used files, terms, and utilities:
cp
,
find
,
mkdir
,
mv
,
ls
,
rm
,
rmdir
,
touch
,
tar
,
cpio
,
dd
,
file
,
gzip
,
gunzip
,
bzip2
,
bunzip2
,
xz
,
unxz
, file globbing.
Redirecting standard input, standard output and standard error.
Pipe the output of one command to the input of another command.
Use the output of one command as arguments to another command.
Send output to both stdout and a file.
The following is a partial list of the used files, terms, and utilities:
tee
,
xargs
.
Run jobs in the foreground and background.
Signal a program to continue running after logout.
Monitor active processes.
Select and sort processes for display.
Send signals to processes.
The following is a partial list of the used files, terms, and utilities:
&
,
bg
,
fg
,
jobs
,
kill
,
nohup
,
ps
,
top
,
free
,
uptime
,
pgrep
,
pkill
,
killall
,
watch
,
screen
,
tmux
.
Know the default priority of a job that is created.
Run a program with higher or lower priority than the default.
Change the priority of a running process.
The following is a partial list of the used files, terms, and utilities:
nice
,
ps
,
renice
,
top
Create simple regular expressions containing several notational elements.
Understand the difference between basic and extended regular expressions.
Understand the concepts of special characters, character classes, quantifiers, and anchors.
Use regular expression tools to perform searches through a filesystem or file content.
Use regular expressions to delete, change, and substitute text.
The following is a partial list of the used files, terms, and utilities:
grep
,
egrep
,
fgrep
,
sed
,
regex(7)
.
Navigate a document using
vi
.
Understand and use
vi
modes.
Insert, edit, delete, copy and find text in
vi
.
Awareness of Emacs, nano, and vim.
Configure the standard editor.
The following is a partial list of the used files, terms, and utilities:
vi
,
/
,
?
,
h
,
j
,
k
,
l
,
i
,
o
,
a
,
d
,
p
,
y
,
dd
,
yy
,
ZZ
,
:w!
,
:q!
,
EDITOR.
Manage MBR and GPT partition tables.
Use various
mkfs
commands to create various filesystems such as: ext2, ext3,ext4, XFS, VFAT, and exFAT.
Basic feature knowledge of Btrfs, including multi-device filesystems, compression, and subvolumes.
The following is a partial list of the used files, terms, and utilities:
fdisk
,
gdisk
,
parted
,
mkfs
,
mkswap
.
Verify the integrity of filesystems.
Monitor free space and inodes.
Repair simple filesystem problems.
The following is a partial list of the used files, terms, and utilities:
du
,
df
,
fsck
,
e2fsck
,
mke2fs
,
tune2fs
, xfs tools (such as
xfs_repair
,
xfs_fsr
, and
xfs_db
).
Manually mount and unmount filesystems.
Configure filesystem mounting on bootup.
Configure user mountable removeable filesystems.
Use of labels and UUIDs for identifying and mounting file systems.
Awareness of systemd mount units.
The following is a partial list of the used files, terms, and utilities:
/etc/fstab
,
/media/
,
mount
,
umount
,
blkid
,
lsblk.
Manage access permissions on regular and special files as well as directories.
Use access modes such as suid, sgid and the sticky bit to maintain security.
Know how to change the file creation mask.
Use the group field to grant file access to group members.
The following is a partial list of the used files, terms, and utilities:
chmod
,
umask
,
chown
,
chgrp
.
Create links.
Identify hard and/or soft links.
Copying versus linking files.
Use links to support system administration tasks.
The following is a partial list of the used files, terms, and utilities:
ln
,
ls
.
Understand the correct locations of files under the FHS.
Find files and commands on a Linux system.
Know the location and propose of important file and directories as defined in the FHS.
The following is a partial list of the used files, terms, and utilities:
find
,
locate
,
updatedb
,
whereis
,
which
,
type
,
/etc/updatedb.conf
.
The 102-500 exam comprises six topics (105–110), each of which contains three or four objectives. The six major topics are:
Subject Area
105 Shells and Shell Scripting
106 User Interfaces and Desktops
107 Administrative Tasks
108 Essential System Services
109 Networking Fundamentals
110 Security
Set environment variables (e.g.,
PATH
) at login or when spawning a new shell.
Write Bash functions for frequently used sequences of commands.
Maintain skeleton directories for new user accounts.
Set command search path with the proper directory.
The following is a partial list of the used files, terms, and utilities:
.
,
source
,
etc/bash.bashrc
,
/etc/profile
,
env
,
export
,
set
,
unset
,
~/.bash_profile
,
~/.bash_login
,
~/.profile
,
~/.bashrc
,
~/.bash_logout
,
function
,
alias
.
Use standard
sh
syntax (loops, tests).
Use command substitution.
Test return values for success or failure or other information provided by a command.
Execute chained commands.
Perform conditional mailing to the superuser.
Correctly select the script interpreter through the shebang (
#!
) line.
Manage the location, ownership, execution and suid-rights of scripts.
The following is a partial list of the used files, terms, and utilities:
for
,
while
,
test
,
if
,
read
,
seq
,
exec
,
||
,
&&
.
Understanding of the X11 architecture.
Basic understanding and knowledge of the X Window configuration file.
Overwrite specific aspects of Xorg configuration, such as keyboard layout.
Understand the components of desktop environments, such as display managers and window managers.
Manage access to the X server and display applications on remote X servers.
Awareness of Wayland.
The following is a partial list of the used files, terms, and utilities:
/etc/X11/xorg .conf
,
/etc/X11/xorg.conf.d
,
~/.xsession-errors
,
xhost
,
xauth
,
DISPLAY
, X.
Awareness of major desktop environments.
Awareness of protocols to access remote desktop sessions.
The following is a partial list of the used files, terms, and utilities: KDE, Gnome, Xfce, X11, XDMCP, VNC, Spice, RDP.
Basic knowledge of visual settings and themes.
Basic knowledge of Assistive Technologies (ATs).
The following is a partial list of the used files, terms, and utilities: High Contrast/Large Print Desktop Themes, Screen Reader, Braille Display, Screen Magnifier, On-Screen Keyboard, Sticky/Repeat keys, Slow/Bounce/Toggle keys, Mouse keys, Gestures, Voice recognition.
Add, modify and remove users and groups.
Manage user/group info in password/group databases.
Create and manage special purpose and limited accounts.
The following is a partial list of the used files, terms, and utilities:
/etc/passwd
,
/etc/shadow
,
/etc/group
,
/etc/skel
,
chage
,
getent
,
groupadd
,
groupdel
,
groupmod
,
passwd
,
useradd
,
userdel
,
usermod
.
Manage
cron
and
at
jobs.
Configure user access to
cron
and
at
services.
Understand systemd timer units.
The following is a partial list of the used files, terms, and utilities:
/etc/cron.{d, daily,hourly,monthly,weekly}
,
/etc/at.deny
,
/etc/at.allow
,
/etc/crontab
,
/etc/cron.allow
,
/etc/cron.deny
,
/var/spool/cron/
,
crontab
,
at
,
atq
,
atrm
,
systemctl
,
systemd-run
.
Configure locale settings and environment variables.
Configure timezone settings and environment variables.
The following is a partial list of the used files, terms, and utilities:
/etc/timezone
,
/etc/localtime
,
/usr/share/zoneinfo
, environment variables (
LC_*
,
LC_ALL
,
LANG
,
TZ
),
/usr/bin/locale
,
tzselect
,
timedatectl
,
date
,
iconv
, UTF-8, ISO-8859, ASCII, Unicode.
Set the system date and time.
Set the hardware clock to the correct time in UTC.
Configure the correct timezone.
Basic NTP configuration using ntpd and chrony.
Knowledge of using the
pool.ntp.org
service.
Awareness of the
ntpq
command.
The following is a partial list of the used files, terms, and utilities:
/usr/share/zoneinfo
,
/etc/timezone
,
/etc/localtime
,
/etc/ntp.conf
,
/etc/chrony.conf
,
date
,
hwclock
,
timedatectl
,
ntpd
,
ntpdate
,
chronyc
,
pool.ntp.org
.
Basic configuration of rsyslogd.
Understanding of standard facilities, priorities, and actions.
Query the systemd journal.
Filter systemd journal data by criteria such as date, service, or priority.
Delete old systemd journal data.
Retrieve systemd journal data from a rescue system or file system copy.
Understand the interaction of rsyslogd with systemd-journald.
Configuration of logrotate.
Awareness of syslog and syslog-ng.
The following is a partial list of the used files, terms, and utilities:
/etc/rsyslog.conf
,
/var/log
,
logger
,
logrotate
,
/etc/logrotate.conf
,
/etc/logrotate.d/
,
journalctl
,
systemd-cat
,
/etc/system/journal.conf
,
/var/log/journal/
.
Create e-mail aliases.
Configure e-mail forwarding.
Knowledge of commonly available MTA programs (postfix, sendmail, qmail, exim) (no configuration).
The following is a partial list of the used files, terms, and utilities:
~/.forward
, sendmail emulation layer commands,
newaliases
,
,
mailq
, postfix, sendmail, exim.
Basic CUPS configuration (for local and remote printers).
Manage user print queues.
Troubleshoot general printing problems.
Add and remove jobs from configured printer queues.
The following is a partial list of the used files, terms, and utilities: CUPS configuration files, tools and utilities;
/etc/cups
;
lpd
legacy interface (
lpr
,
lprm
,
lpq
).
Demonstrate an understanding of network masks and CIDR notation.
Knowledge of the differences between private and public “dotted quad” IP-Addresses.
Knowledge about common TCP and UDP ports (20, 21, 22, 23, 25, 53, 80, 110, 123, 139, 143, 161, 162, 389, 443, 465, 514, 636, 993, 995).
Knowledge about the differences and major features of UDP, TCP and ICMP.
Knowledge of the major differences between IPv4 and IPV6.
Knowledge of the basic features of IPv6.
The following is a partial list of the used files, terms, and utilities:
/etc/services
, IPv4, IPv6, subnetting, TCP, UDP, ICMP.
Understand basic TCP/IP host configuration.
Configure Ethernet and wi-fi configuration using NetworkManager.
Awareness of systemd-networkd.
The following is a partial list of the used files, terms, and utilities:
/etc/hostname
,
/etc/hosts
,
/etc/nsswitch.conf
,
/etc/resolv.conf
,
nmcli
,
hostnamectl
,
ifup
,
ifdown
.
Manually configure network interfaces, including viewing and changing the configuration of network interfaces using iproute2.
Manually configure routing, including viewing and changing routing tables and setting the default route using iproute2.
Debug problems associated with the network configuration.
Awareness of legacy net-tools commands.
The following is a partial list of the used files, terms, and utilities:
ip
,
hostname
,
ss
,
ping
,
ping6
,
traceroute
,
traceroute6
,
tracepath
,
tracepath6
,
netcat
,
ifconfig
,
netstat
,
route
.
Query remote DNS servers.
Configure local name resolution and use remote DNS servers.
Modify the order in which name resolution is done.
Debug errors related to name resolution.
Awareness of systemd-resolved.
The following is a partial list of the used files, terms, and utilities:
/etc/hosts
,
/etc/resolv.conf
,
/etc/nsswitch.conf
,
host
,
dig
,
getent
.
Audit a system to find files with the suid/sgid bit set.
Set or change user passwords and password aging information.
Being able to use
nmap
and
netstat
to discover open ports on a system.
Set up limits on user logins, processes and memory usage.
Determine which users have logged in to the system or are currently logged in.
Basic
sudo
configuration and usage.
The following is a partial list of the used files, terms, and utilities:
find
,
passwd
,
fuser
,
lsof
,
nmap
,
chage
,
netstat
,
sudo
,
/etc/sudoers
,
su
,
usermod
,
ulimit
,
who
,
w
,
last
.
Awareness of shadow passwords and how they work.
Turn off network services not in use.
Understand the role of TCP wrappers.
The following is a partial list of the used files, terms, and utilities:
/etc/nologin
,
/etc/passwd
,
/etc/shadow
,
/etc/xinetd.d/
,
/etc/xinetd.conf
,
/etc/inetd.d/
,
/etc/inetd.conf
,
systemd-socket
,
/etc/inittab
,
/etc/init.d/
,
/etc/hosts.allow
,
/etc/hosts.deny
.
Perform basic OpenSSH 2 client configuration and usage.
Understand the role of OpenSSH 2 server host keys.
Perform basic GnuPG configuration, usage, and revocation.
Use GPG to encrypt, decrypt, sign, and verify files.
Understand SSH port tunnels (including X11 tunnels).
The following is a partial list of the used files, terms, and utilities:
ssh
,
ssh-keygen
,
ssh-agent
,
ssh-add
,
~/.ssh/id_rsa
and
id_rsa.pub
,
~/.ssh/id_rsa
and
id_rsa.pub
,
~/.ssh/id_dsa
and
id_dsa.pub
,
~/.ssh/id_ecdsa
and
ecdsa.pub
,
~/.ssh/id_ed25519
and
id_ed25519.pub
,
/etc/ssh/ssh_host_rsa_key
and
ssh_host_rsa_key.pub
,
/etc/ssh/ssh_host_dsa_key
and
ssh_host_dsa_key.pub
,
/etc/ssh/ssh_host_ecdsa_key
and
host_ecdsa_key.pub
,
/etc/ssh/ssh_host_ed25519_key
and
host_ed25519_key .pub
,
~/.ssh/authorized_keys
,
/etc/ssh_known_hosts
,
gpg
,
gpg-agent
,
~/.gnupg/
.
Which of the following are names of shell programs? (Choose all that apply.)
BashKorn ShellBorn ShellDashZ ShellYou are a system administrator on a CentOS Linux server. You need to view records in the /var/log/messages file that start with the date May 30 and end with the IPv4 address 192.168.10.42. Which of the following is the best grep command to use?
grep "May 30?192.168.10.42" /var/log/messagesgrep "May 30.*192.168.10.42" /var/log/messagesgrep -i "May 30.*192.168.10.42" /var/log/messagesgrep -i "May 30?192.168.10.42" /var/log/messagesgrep -v "May 30.*192.168.10.42" /var/log/messagesWhich of the following commands will determine how many records in the file Problems.txt contain the word error?
grep error Problems.txt | wc -bgrep error Problems.txt | wc -wgrep error Problems.txt | wc -lgrep Problems.txt error | wc -wgrep Problems.txt error | wc -lWhich of the following conforms to the standard naming format of a Debian package file? (Choose all that apply.)
openssh-client_1%3a7.6pl-4ubuntu0.3_amd64.debopenssh-client-3a7-24_86_x64.rpmzsh_5.4.2-3ubuntu3.1_amd64.debzsh_5.4.2-3ubuntu3.1_amd64.dpkgemacs_47.0_all.dpkgWhat does placing an ampersand sign (&) after a command on the command line do?
Disconnects the command from the terminal session.Runs the command in foreground mode.Runs the command in background mode.Redirects the output to another command.Redirects the output to a file.If you are using the tmux utility how do you create a new window?
screen tmux createtmux lsscreen -lstmux newWhat type of hardware interface uses interrupts, I/O ports, and DMA channels to communicate with the PC motherboard?
USBGPIOPCIMonitorsPrintersWhat directory does the Linux FHS set aside specifically for installing third party programs?
/usr/bin/usr/opt/usr/sbin/tmpWhich command allows you to append a partition to the virtual directory on a running Linux system?
mountumountfsckdmesgmkinitramfsThe system admin took an archive file and applied a compression utility to it. The resulting file extension is .gz. Which compression utility was used?
The xz utilityThe gzip utilityThe bzip2 utilityThe zip utilityThe dd utilityBefore the umask setting is applied, a directory has a default permission octal code of which of the following?
111755666777888You need to locate files within the /tmp directory or one of its subdirectories. These files should be empty. Assuming you have super user privileges, what command should you use?
find / -name tmpfind /tmp -emptyfind /tmp -empty 0find /tmp/* -name emptyfind / -emptyWhere does the system BIOS attempt to find a bootloader program? (Choose all that apply.)
An internal hard driveAn external hard driveA DVD driveA USB flash driveA network serverWhich firmware method has replaced BIOS on most modern IBM-compatible computers?
FTPUEFIPXENFSHTTPSWhich of the following are system initialization methods? (Choose all that apply.)
/sbin/init/etc/initSysVinitsystemdcloud-initThe Cinnamon desktop environment uses which windows manager?
MutterMuffinNemoDolphinLightDMYour X.org session has become hung. What keystrokes do you use to restart the session?
Ctrl+CCtrl+ZCtrl+QCtrl+Alt+DeleteCtrl+Alt+BackspaceWhat folder contains the time zone template files in Linux?
/etc/timezone/etc/localtime/usr/share/zoneinfo/usr/share/timezone/usr/share/localtimeWhich field contains the same data for both a /etc/passwd and /etc/shadow file record?
PasswordAccount expiration dateUIDGIDUser account's usernameWhat facility and priority setting would log kernel messages that are warnings and higher severity?
kern.=warnkern.**.infokern.warnkern.alertWhich of the following can implement NTP on Linux? (Choose all that apply.)
EximntpdSendmailPostfixchronydWhich network layer uses the Wi-Fi Protected Access (WPA) encryption?
networkphysicaltransportapplicationWhich two commands set the IP address, subnet mask, and default router information on an interface using the command line?
netstatpingnmtuiiprouteWhat tool allows you to send ICMP messages to a remote host to test network connectivity?
netstatifconfigpingiwconfigssWhich Bash shell script command allows you to iterate through a series of data until the data is complete?
ifcaseforexit$()Which environment variable allows you to retrieve the numeric user ID value for the user account running a shell script?
$USER$UID$BASH$HOME$1When will the cron table entry 0 0 1 * * myscript run the specified command?
At 1AM every day.At midnight on the first day of every month.At midnight on the first day of every week.At 1PM every day.At midnight every day.Which of the following utilities allows you to scan a system and see what network services are being offered or used via the files that are open?
fuserlsofnmapnetstatss