• Aucun résultat trouvé

ffirs.indd ii ffirs.indd ii 11/12/12 12:25 PM 11/12/12 12:25 PM

N/A
N/A
Protected

Academic year: 2022

Partager "ffirs.indd ii ffirs.indd ii 11/12/12 12:25 PM 11/12/12 12:25 PM"

Copied!
650
0
0

Texte intégral

(1)
(2)

ffirs.indd ii

ffirs.indd ii 11/12/12 12:25 PM11/12/12 12:25 PM

(3)

LPIC-1

Linux Professional Institute Certification

Study Guide

Third Edition

(4)

ffirs.indd ii

ffirs.indd ii 11/12/12 12:25 PM11/12/12 12:25 PM

(5)

LPIC-1

Linux Professional Institute Certification

Study Guide

Third Edition

Roderick W. Smith

John Wiley & Sons, Inc.

(6)

Senior Acquisitions Editor: Jeff Kellum Development Editor: Alexa Murphy

Technical Editors: Ross Brunson and Kevin Glendenning, FOSSter.com Production Editor: Eric Charbonneau

Copy Editor: Kim Wimpsett Editorial Manager: Pete Gaughan Production Manager: Tim Tate

Vice President and Executive Group Publisher: Richard Swadley Vice President and Publisher: Neil Edde

Media Project Manager 1: Laura Moss-Hollister Media Associate Producer: Doug Kuhn Media Quality Assurance: Josh Frank Book Designer: Judy Fung

Proofreader: Candace Cunningham Indexer: Ted Laux

Project Coordinator, Cover: Katherine Crocker Cover Designer: Ryan Sneed

Copyright © 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada

ISBN: 978-1-118-49563-6 ISBN: 978-1-118-52648-4 (ebk.) ISBN: 978-1-118-57047-0 (ebk.) ISBN: 978-1-118-57055-5 (ebk.)

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 per- mission 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 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 war- ranties, 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: 2012951869

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. 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.

10 9 8 7 6 5 4 3 2 1

ffirs.indd iv

ffirs.indd iv 11/12/12 12:25 PM11/12/12 12:25 PM

(7)

Thank you for choosing LPIC-1: Linux Professional Institute Certifi cation Study Guide, Third Edition. This book is part of a family of premium-quality Sybex books, all of which are written by outstanding authors who combine practical experience with a gift for teaching.

Sybex was founded in 1976. More than 30 years later, we’re still committed to producing consistently exceptional books. With each of our titles, we’re working hard to set a new standard for the industry. From the paper we print on to the authors we work with, our goal is to bring you the best books available.

I hope you see all that refl ected in these pages. I’d be very interested to hear your

comments and get your feedback on how we’re doing. Feel free to let me know what you think about this or any other Sybex book by sending me an email at nedde@wiley.com. If you think you’ve found a technical error in this book, please visit http://sybex.custhelp.com.

Customer feedback is critical to our efforts at Sybex.

Best regards,

Neil Edde

Vice President and Publisher Sybex, an Imprint of Wiley

(8)

ffirs.indd vi

ffirs.indd vi 11/12/12 12:25 PM11/12/12 12:25 PM

(9)

Although this book bears my name as author, many other people contributed to its creation. Without their help, this book wouldn’t exist, or at best would exist in a lesser form. Jeff Kellum was the acquisitions editor and so helped get the book started. Alexa Murphy, the developmental editor, and Eric Charbonneau, the production editor, oversaw the book as it progressed through all its stages. Ross Brunson and Kevin Glendenning were the technical editors who checked the text for technical errors and omissions — but any mistakes that remain are my own. Kim Wimpsett, the copy editor, helped keep the text grammatical and understandable. The proofreader, Candace Cunningham, checked the text for typos. I’d also like to thank Neil Salkind and others at Studio B, who helped connect me with Wiley to write this book.

(10)

ffirs.indd viii

ffirs.indd viii 11/12/12 12:25 PM11/12/12 12:25 PM

(11)

Roderick W. Smith is a Linux consultant and author. He has written more than 20 books on Linux, FreeBSD, and computer networking, including Linux Essentials, the LPIC-2 Study Guide, and Linux Administrator Street Smarts (all from Sybex). He can be reached at rodsmith@rodsbooks.com.

(12)

ffirs.indd x

ffirs.indd x 11/12/12 12:25 PM11/12/12 12:25 PM

(13)

Introduction xxiii

Exam Objectives xxix

- Exam 101 Objectives xxix

- Exam 102 Objectives xxxv

Assessment Test xli

Answers to the Assessment Test xlviii

Part I Exam 101 1

Chapter 1 Exploring Linux Command-Line Tools 3

Chapter 2 Managing Software 45

Chapter 3 Configuring Hardware 105

Chapter 4 Managing Files 175

Chapter 5 Booting Linux and Editing Files 223

Part II Exam 102 265 Chapter 6 Configuring the X Window System,

Localization, and Printing 267

Chapter 7 Administering the System 329

Chapter 8 Configuring Basic Networking 381

Chapter 9 Writing Scripts, Configuring Email, and Using Databases 425

Chapter 10 Securing Your System 473

Appendix A Answers to Review Questions 517

Appendix B About the Additional Study Tools 553

Index 557

(14)

ffirs.indd xii

ffirs.indd xii 11/12/12 12:25 PM11/12/12 12:25 PM

(15)

Introduction xxiii

Exam Objectives xxix

- Exam 101 Objectives xxix

- Exam 102 Objectives xxxv

Assessment Test xli

Answers to the Assessment Test xlviii

Part I Exam 101 1

Chapter 1 Exploring Linux Command-Line Tools 3

Understanding Command-Line Basics 4

Exploring Your Linux Shell Options 4

Using a Shell 5

Exploring Shell Configuration 12

Using Environment Variables 12

Getting Help 13

Using Streams, Redirection, and Pipes 14

Exploring Types of Streams 15

Redirecting Input and Output 15

Piping Data Between Programs 17

Generating Command Lines 18

Processing Text Using Filters 19

File-Combining Commands 19

File-Transforming Commands 21

File-Formatting Commands 25

File-Viewing Commands 28

File-Summarizing Commands 30

Using Regular Expressions 32

Understanding Regular Expressions 32

Using grep 33 Using sed 35 Summary 37

Exam Essentials 38

Review Questions 39

(16)

xiv Contents

Chapter 2 Managing Software 45

Package Concepts 46

Using RPM 48

RPM Distributions and Conventions 48

The rpm Command Set 51

Extracting Data from RPMs 54

Using Yum 55

RPM and Yum Configuration Files 59

RPM Compared to Other Package Formats 60

Using Debian Packages 61

Debian Distributions and Conventions 61

The dpkg Command Set 62

Using apt-cache 65

Using apt-get 65

Using dselect, aptitude, and Synaptic 69

Reconfiguring Packages 71

Debian Packages Compared to Other Package Formats 71

Configuring Debian Package Tools 72

Converting Between Package Formats 73

Package Dependencies and Conflicts 75

Real and Imagined Package Dependency Problems 75 Workarounds for Package Dependency Problems 76

Startup Script Problems 78

Managing Shared Libraries 79

Library Principles 79

Locating Library Files 81

Library Management Commands 83

Managing Processes 85

Understanding the Kernel: The First Process 85

Examining Process Lists 86

Understanding Foreground and Background

Processes 92

Managing Process Priorities 93

Killing Processes 94

Summary 96

Exam Essentials 96

Review Questions 98

Chapter 3 Configuring Hardware 105

Configuring the Firmware and Core Hardware 106 Understanding the Role of the Firmware 106 IRQs 110

I/O Addresses 113

DMA Addresses 114

ftoc.indd xiv

ftoc.indd xiv 11/12/12 12:26 PM11/12/12 12:26 PM

(17)

Boot Disks and Geometry Settings 114

Coldplug and Hotplug Devices 117

Configuring Expansion Cards 118

Configuring PCI Cards 118

Learning about Kernel Modules 120

Loading Kernel Modules 121

Removing Kernel Modules 123

Configuring USB Devices 124

USB Basics 124

Linux USB Drivers 125

USB Manager Applications 126

Configuring Hard Disks 126

Configuring PATA Disks 127

Configuring SATA Disks 128

Configuring SCSI Disks 128

Configuring External Disks 130

Designing a Hard Disk Layout 130

Why Partition? 130

Understanding Partitioning Systems 131

An Alternative to Partitions: LVM 134

Mount Points 134

Common Partitions and Filesystem Layouts 135

Creating Partitions and Filesystems 136

Partitioning a Disk 137

Preparing a Partition for Use 141

Maintaining Filesystem Health 148

Tuning Filesystems 148

Maintaining a Journal 152

Checking Filesystems 153

Monitoring Disk Use 155

Mounting and Unmounting Filesystems 158

Temporarily Mounting or Unmounting Filesystems 159

Permanently Mounting Filesystems 164

Summary 166

Exam Essentials 167

Review Questions 169

Chapter 4 Managing Files 175

Using File Management Commands 176

File Naming and Wildcard Expansion Rules 176

File Commands 178

File Archiving Commands 183

Managing Links 190

Directory Commands 191

(18)

xvi Contents

Managing File Ownership 192

Assessing File Ownership 192

Changing a File’s Owner 193

Changing a File’s Group 194

Controlling Access to Files 194

Understanding Permissions 194

Changing a File’s Mode 199

Setting the Default Mode and Group 202

Changing File Attributes 204

Managing Disk Quotas 205

Enabling Quota Support 205

Setting Quotas for Users 206

Locating Files 207

The FHS 207

Tools for Locating Files 211

Summary 215

Exam Essentials 216

Review Questions 218

Chapter 5 Booting Linux and Editing Files 223

Installing Boot Loaders 224

Boot Loader Principles 225

Using GRUB Legacy as the Boot Loader 228

Using GRUB 2 as the Boot Loader 234

Using Alternative Boot Loaders 236

Understanding the Boot Process 237

Extracting Information about the Boot Process 238 Locating and Interpreting Boot Messages 238

The Boot Process 239

Dealing with Runlevels and the Initialization Process 240

Runlevel Functions 240

Identifying the Services in a Runlevel 241

Managing Runlevel Services 243

Checking Your Runlevel 245

Changing Runlevels on a Running System 246

Using Alternative Boot Systems 249

Configuring Upstart 249

Using systemd 251

Editing Files with Vi 252

Understanding Vi Modes 252

Exploring Basic Text-Editing Procedures 253

Saving Changes 256

Summary 256

Exam Essentials 257

Review Questions 259

ftoc.indd xvi

ftoc.indd xvi 11/12/12 12:26 PM11/12/12 12:26 PM

(19)

Part II Exam 102 265

Chapter 6 Configuring the X Window System,

Localization, and Printing 267

Configuring Basic X Features 268

X Server Options for Linux 268

Methods of Configuring X 270

X Configuration Options 273

Obtaining X Display Information 281

Configuring X Fonts 283

Font Technologies and Formats 284

Configuring X Core Fonts 284

Configuring a Font Server 287

Configuring Xft Fonts 288

Managing GUI Logins 289

The X GUI Login System 289

Running an XDMCP Server 290

Configuring an XDMCP Server 292

Using X for Remote Access 294

X Client-Server Principles 294

Using Remote X Clients 295

X Accessibility 297

Keyboard and Mouse Accessibility Issues 297

Screen Display Settings 300

Using Additional Assistive Technologies 301 Configuring Localization and Internationalization 302

Setting Your Time Zone 302

Querying and Setting Your Locale 305

Configuring Printing 308

Conceptualizing the Linux Printing Architecture 309 Understanding PostScript and Ghostscript 310

Running a Printing System 311

Configuring CUPS 312

Monitoring and Controlling the Print Queue 318 Summary 322

Exam Essentials 322

Review Questions 324

Chapter 7 Administering the System 329

Managing Users and Groups 330

Understanding Users and Groups 330

Configuring User Accounts 333

Configuring Groups 344

Tuning User and System Environments 348

Using System Log Files 349

(20)

xviii Contents

Understanding syslogd 350

Setting Logging Options 350

Manually Logging Data 352

Rotating Log Files 353

Reviewing Log File Contents 356

Maintaining the System Time 358

Linux Time Concepts 358

Manually Setting the Time 359

Using NTP 360

Running Jobs in the Future 366

Understanding the Role of cron 367

Creating System cron Jobs 367

Creating User cron Jobs 369

Using anacron 371 Using at 373 Summary 374

Exam Essentials 375

Review Questions 376

Chapter 8 Configuring Basic Networking 381

Understanding TCP/IP Networking 382

Knowing the Basic Functions of Network Hardware 382 Investigating Types of Network Hardware 383

Understanding Network Packets 385

Understanding Network Protocol Stacks 385

Knowing TCP/IP Protocol Types 387

Understanding Network Addressing 389

Using Network Addresses 389

Resolving Hostnames 395

Network Ports 398

Configuring Linux for a Local Network 402

Network Hardware Configuration 402

Configuring with DHCP 402

Configuring with a Static IP Address 403

Configuring Routing 406

Using GUI Configuration Tools 408

Using the ifup and ifdown Commands 408

Configuring Hostnames 409

Diagnosing Network Connections 411

Testing Basic Connectivity 412

Tracing a Route 412

Checking Network Status 413

Examining Raw Network Traffic 414

Using Additional Tools 415

ftoc.indd xviii

ftoc.indd xviii 11/12/12 12:26 PM11/12/12 12:26 PM

(21)

Summary 418

Exam Essentials 418

Review Questions 420

Chapter 9 Writing Scripts, Configuring Email,

and Using Databases 425

Managing the Shell Environment 426

Reviewing Environment Variables 426

Understanding Common Environment Variables 427

Using Aliases 431

Modifying Shell Configuration Files 431

Writing Scripts 433

Beginning a Shell Script 434

Using Commands 435

Using Variables 437

Using Conditional Expressions 440

Using Loops 442

Using Functions 443

Managing Email 445

Understanding Email 445

Choosing Email Software 447

Working with Email 448

Securing Your Email Server 452

Managing Data with SQL 453

Picking a SQL Package 453

Understanding SQL Basics 454

Using MySQL 456

Summary 465

Exam Essentials 465

Review Questions 467

Chapter 10 Securing Your System 473

Administering Network Security 474

Using Super Server Restrictions 475

Disabling Unused Servers 481

Administering Local Security 488

Securing Passwords 488

Limiting root Access 492

Setting Login, Process, and Memory Limits 493

Locating SUID/SGID Files 495

Configuring SSH 497

SSH Basics 497

Setting SSH Options for Your Computer 498

SSH Security Considerations 505

(22)

xx Contents

Using GPG 506

Generating Keys 506

Importing Keys 507

Revoking a Key 508

Encrypting and Decrypting Data 508

Signing Messages and Verifying Signatures 509 Summary 510

Exam Essentials 510

Review Questions 512

Appendix A Answers to Review Questions 517

Chapter 1: Exploring Linux Command-Line Tools 518

Chapter 2: Managing Software 521

Chapter 3: Configuring Hardware 524

Chapter 4: Managing Files 528

Chapter 5: Booting Linux and Editing Files 531 Chapter 6: Configuring the X Window System,

Localization, and Printing 534

Chapter 7: Administering the System 538

Chapter 8: Configuring Basic Networking 542

Chapter 9: Writing Scripts, Configuring Email, and

Using Databases 546

Chapter 10: Securing Your System 549

Appendix B About the Additional Study Tools 553

Additional Study Tools 554

Sybex Test Engine 554

Electronic Flashcards 554

PDF of Glossary of Terms 554

Adobe Reader 554

System Requirements 555

Using the Study Tools 555

Troubleshooting 556

Cus tomer Care 556

Index 557

ftoc.indd xx

ftoc.indd xx 11/12/12 12:26 PM11/12/12 12:26 PM

(23)

Exercise 1.1 Editing Commands . . . 11 Exercise 2.1 Managing Packages Using RPM . . . 57 Exercise 2.2 Managing Debian Packages. . . 68 Exercise 3.1 Creating Filesystems . . . 146 Exercise 4.1 Modifying Ownership and Permissions. . . 201 Exercise 4.2 Locating Files . . . 215 Exercise 5.1 Changing Runlevels . . . 248 Exercise 6.1 Printing with Linux . . . 321 Exercise 7.1 Creating User Accounts . . . 338 Exercise 7.2 Creating User cron Jobs . . . 370 Exercise 8.1 Practice Resolving Hostnames . . . 396 Exercise 8.2 Configuring a Network Connection . . . 409 Exercise 9.1 Changing Your bash Prompt . . . 430 Exercise 9.2 Creating a Simple Script . . . 444 Exercise 9.3 Creating a SQL Database . . . 460 Exercise 10.1 Monitor Network Port Use . . . 482

(24)

flast.indd xxii

flast.indd xxii 11/12/12 12:26 PM11/12/12 12:26 PM

(25)

Why should you learn about Linux? It’s a fast-growing operating system, and it is inexpen- sive and fl exible. Linux is also a major player in the small and mid-sized server fi eld, and it’s an increasingly viable platform for workstation and desktop use as well. By understanding Linux, you’ll increase your standing in the job market. Even if you already know Windows or Mac OS and your employer uses these systems exclusively, understanding Linux will give you an edge when you’re looking for a new job or you’re looking for a promotion. For instance, this knowledge will help you make an informed decision about if and when you should deploy Linux.

The Linux Professional Institute (LPI) has developed its LPI-1 certifi cation as an intro- ductory certifi cation for people who want to enter careers involving Linux. The exam is meant to certify that an individual has the skills necessary to install, operate, and trouble- shoot a Linux system and is familiar with Linux-specifi c concepts and basic hardware.

The purpose of this book is to help you pass the LPIC-1 exams (101 and 102) updated in 2012. Because these exams cover basic Linux installation, confi guration, 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 confi gure it for many common tasks. Even after you’ve taken and passed the LPIC-1 exams, this book should remain a useful reference.

What Is Linux?

Linux is a clone of the Unix operating system (OS) that has been popular in academia and many business environments for years. Formerly used exclusively on large mainframes, Unix and Linux can now run on small computers—which are actually far more powerful than the mainframes of just a few years ago. Because of its mainframe heritage, Unix (and hence also Linux) scales well to perform today’s demanding scientifi c, engineering, and net- work server tasks.

Linux consists of a kernel, which is the core control software, and many libraries and utilities that rely on the kernel to provide features with which users interact. The OS is available in many different distributions, which are collections of a specifi c kernel with specifi c support programs.

(26)

xxiv Introduction

Why Become Linux Certified?

Several good reasons to get your Linux certifi cation exist. There are four major benefi ts:

Relevance The exams were designed with the needs of Linux professionals in mind. This was done by performing surveys of Linux administrators to learn what they actually need to know to do their jobs.

Quality The exams have been extensively tested and validated using psychometric stan- dards. The result is an ability to discriminate between competent administrators and those who must still learn more material.

Neutrality LPI is an organization that doesn’t itself market any Linux distribution. This fact removes the motivation to create an exam that’s designed as a way to market a particular distribution.

Support The exams are supported by major players in the Linux world.

How to Become Certified

The certifi cation is available to anyone who passes the two required exams: 101 and 102.

You don’t have to work for a particular company. It’s not a secret society.

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 certifi cate 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 http://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).

Who Should Buy This Book

Anybody who wants to pass the certifi cation exams may benefi t from this book. This book covers the material that someone new to Linux will need to learn the OS from the begin- ning, and it continues to provide the knowledge you need up to a profi ciency level suffi cient to pass the two exams. You can pick up this book and learn from it even if you’ve never used Linux before, although you’ll fi nd it an easier read if you’ve at least casually used Linux for a few days. If you’re already familiar with Linux, this book can serve as a review and as a refresher course for information with which you might not be completely familiar.

In either case, reading this book will help you pass the exams.

This book is written with the assumption that you know at least a little bit about Linux (what it is and possibly a few Linux commands). I also assume you know some basics about

flast.indd xxiv

flast.indd xxiv 11/12/12 12:26 PM11/12/12 12:26 PM

(27)

computers in general, such as how to use a keyboard, how to insert a disc into an optical drive, and so on. Chances are, you have used computers in a substantial way in the past—

perhaps even Linux, as an ordinary user, or maybe you have used Windows or Mac OS. I do not assume that you have extensive knowledge of Linux system administration, but if you’ve done some system administration, you can still use this book to fi ll in gaps in your knowledge.

As a practical matter, you’ll need a Linux system with which to practice and learn in a hands-on way. Neither the exams nor this book covers actu- ally installing Linux on a computer from scratch, although some of the prerequisites (such as disk partitioning) are covered. You may need to refer to your distribution’s documentation to learn how to accomplish this task.

Alternatively, several vendors sell computers with Linux pre-installed.

How This Book Is Organized

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,” describes the programs you’ll use to manage soft- ware. 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 hard- ware on which it runs. Specific hardware and procedures for using it include the BIOS, expansion cards, USB devices, hard disks, and the partitions and filesystems used on hard disks.

Chapter 4, “Managing Files,” covers the tools used to manage files. This includes com- mands to manage files, ownership, and permissions, as well as Linux’s standard direc- tory tree and tools for archiving files.

Chapter 5, “Booting Linux and Editing Files,” 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, runlevels, and the Vi editor.

Chapter 6, “Configuring the X Window System, 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.

(28)

xxvi Introduction

Chapter 7, “Administering the System,” describes miscellaneous administrative tasks.

These include user and group management, tuning user environments, managing log files, setting the clock, and running jobs in the future.

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, Configuring Email, and Using Databases,” covers these miscellaneous topics. Scripts are small programs that administrators often use to help automate common tasks. Email, of course, is an important topic for any computer user, particularly on Linux, which often runs an email server for local or remote use. Linux can run databases that help you store and retrieve information, and these tools can be very important ones on many Linux systems.

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 exam, while Chapters 6 through 10 cover the 102 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 fi nd 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 diffi culty.

Th e 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 fi nish 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.

flast.indd xxvi

flast.indd xxvi 11/12/12 12:26 PM11/12/12 12:26 PM

(29)

Additional Study Tools

Readers of this book can access a Web site that contains several additional study tools, including the following:

Readers can access these tools by visiting http://www.sybex.com/go/

lpic3e.

Sample Tests All of the questions in this book will be included, including 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 Mac OS.

Electronic Flashcards The additional study tools includes 150 questions in fl ashcard format (a question followed by a single correct answer). You can use these to review your knowledge of the exam objectives. The fl ashcards 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.

Conventions Used in This Book

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:

(30)

xxviii Introduction

A note indicates information that’s useful or interesting but that’s some- what peripheral to the main text. A note might be relevant to a small num- ber 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 limi- tation or how to use a feature to perform an unusual task.

Warnings describe potential pitfalls or dangers. If you fail to heed a warn- ing, 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.

Sidebar

A sidebar is like a note but longer. The information in a sidebar is useful, but it doesn’t fi t into the main fl ow of the text.

Real World Scenario

A real world scenario is a type of sidebar that describes a task or example that’s par- ticularly grounded in the real world. This may be a situation I or somebody I know has encountered, or it may be advice on how to work around problems that are common in real, working Linux environments.

E X E R C I S E : E X E R C I S E

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 exer- cises, though! Try other commands and procedures to really learn about Linux.

flast.indd xxviii

flast.indd xxviii 11/12/12 12:26 PM11/12/12 12:26 PM

(31)

The Exam Objectives

Behind every computer industry exam you can be sure to fi nd exam objectives—the broad topics in which exam developers want to ensure your competency. The offi cial exam objec- tives 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 Web site (http://www.lpi.org) for the most current listing of exam objectives.

Exam 101 Objectives

The following are the areas in which you must be profi cient in order to pass the 101 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 refl ects its importance to the exam as a whole. 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

101 System Architecture

101.1 Determine and Configure hardware settings (Chapter 3)

Enable and disable integrated peripherals

Configure systems with or without external peripherals such as keyboards

Differentiate between the various types of mass storage devices

Set the correct hardware ID for different devices, especially the boot device

Know the differences between coldplug and hotplug devices

(32)

xxx Introduction

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

101.2 Boot the System (Chapter 5)

Provide common commands to the boot loader and options to the kernel at boot time

Demonstrate knowledge of the boot sequence from BIOS to boot completion

Check boot events in the log file

The following is a partial list of the used files, terms and utilities: /var/log/messages, dmesg, BIOS, bootloader, kernel, init

101.3 Change runlevels and shutdown or reboot s ystem (Chapter 5)

Set the default run level

Change between run levels including single user mode

Shutdown and reboot from the command line

Alert users before switching run levels or other major system events

Properly terminate processes

Knowledge of basic features of systemd and Upstart

The following is a partial list of the used files, terms and utilities: /etc/inittab, shutdown, init, /etc/init.d, telinit

102 Linux Installation and Package Management

102.1 Design hard disk layout (Chapter 3)

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, swap space, mount points, partitions

flast.indd xxx

flast.indd xxx 11/12/12 12:26 PM11/12/12 12:26 PM

(33)

102.2 Install a boot manager (Chapter 5)

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 other variations, grub-install, MBR, superblock

102.3 Manage shared libraries (Chapter 2)

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

102.4 Use Debian package management (Chapter 2)

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)

The following is a partial list of the used files, terms and utilities: /etc/apt/sources .list, dpkg, dpkg-reconfigure, apt-get, apt-cache, aptitude

102.5 Use RPM and YUM package management (Chapter 2)

Install, re-install, upgrade and remove packages using RPM and YUM

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, yumdownloader

(34)

xxxii Introduction

103 GNU and Unix Commands

103.1 Work on the command line (Chapter 1)

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, exec, export, pwd, set, unset, man, uname, history

103.2 Process text streams using filters (Chapter 1)

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: cat, cut, expand, fmt, head, od, join, nl, paste, pr, sed, sort, split, tail, tr, unexpand, uniq, wc

103.3 Perform basic file management (Chapter 4)

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, file globbing

103.4 Use streams, pipes and redirects (Chapter 1)

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

flast.indd xxxii

flast.indd xxxii 11/12/12 12:26 PM11/12/12 12:26 PM

(35)

103.5 Create, monitor and kill processes (Chapter 2)

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, killall

103.6 Modify process execution priorities (Chapter 2)

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

103.7 Search text files using regular expressions (Chapter 1)

Create simple regular expressions containing several notational elements

Use regular expression tools to perform searches through a filesystem or file content

The following is a partial list of the used files, terms and utilities: grep, egrep, fgrep, sed, regex(7)

103.8 Perform basic file editing operations using vi (Chapter 5)

Navigate a document using vi

Use basic vi modes

Insert, edit, delete, copy and find text

The following is a partial list of the used files, terms and utilities: vi, /, ?, h, j, k, l, i, o, a, c, d, p, y, dd, yy, ZZ, :w!, :q!, :e!

104 Devices, Linux Filesystems, Filesystem Hierarchy Standard

104.1 Create partitions and filesystems (Chapter 3)

Use various mkfs commands to set up partitions and create various filesystems such as:

ext2, ext3, xfs, reiserfs v3, vfat

The following is a partial list of the used files, terms and utilities: fdisk, mkfs, mkswap

(36)

xxxiv Introduction

104.2 Maintain the integrity of filesystems (Chapter 3)

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, debugfs, dumpe2fs, tune2fs, xfs tools (such as xfs_metadump and xfs_info)

104.3 Control mounting and unmounting of filesystems (Chapter 3)

Manually mount and unmount filesystems

Configure filesystem mounting on bootup

Configure user mountable removeable filesystems

The following is a partial list of the used files, terms and utilities: /etc/fstab, /media, mount, umount

104.4 Manage disk quotas (Chapter 4)

Set up a disk quota for a filesystem

Edit, check and generate user quota reports

The following is a partial list of the used files, terms and utilities: quota, edquota, repquota, quotaon

104.5 Manage file permissions and ownership (Chapter 4)

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

104.6 Create and change hard and symbolic links (Chapter 4)

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

flast.indd xxxiv

flast.indd xxxiv 11/12/12 12:26 PM11/12/12 12:26 PM

(37)

104.7 Find system files and place files in the correct location (Chapter 4)

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

Exam 102 Objectives

The 102 exam comprises six topics (105–110), each of which contains three or four objectives. The six major topics are:

Subject Area

105 Shells, Scripting and Data Management 106 User Interfaces and Desktops

107 Administrative Tasks 108 Essential System Services 109 Networking Fundamentals 110 Security

105 Shells, Scripting and Data Management

105.1 Customize and use the shell environment (Chapter 9)

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: /etc/profile, env, export, set, unset, ~/.bash_profile, ~/.bash_login, ~/.profile, ~/.bashrc,

~/.bash_logout, function, alias, lists

(38)

xxxvi Introduction

105.2 Customize or write simple scripts (Chapter 9)

Use standard sh syntax (loops, tests)

Use command substitution

Test return values for success or failure or other information provided by a command

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

105.3 SQL data management (Chapter 9)

Use of basic SQL commands

Perform basic data manipulation

The following is a partial list of the used files, terms, and utilities: insert, update, select, delete, from, where, group by, order by, join

106 User Interfaces and Desktops

106.1 Install and configure X11 (Chapter 6)

Verify that the video card and monitor are supported by an X server

Awareness of the X font server

Basic understanding and knowledge of the X Window configuration file

The following is a partial list of the used files, terms, and utilities: /etc/X11/xorg .conf, xhost, DISPLAY, xwininfo, xdpyinfo, X

106.2 Setup a display manager (Chapter 6)

Turn the display manager on or off

Change the display manager greeting

Change default color depth for the display manager

Configure display managers for use by X-stations

The following is a partial list of the used files, terms, and utilities: /etc/inittab; plus xdm, kdm, and gdm configuration files

106.3 Accessibility (Chapter 6)

Keyboard Accessibility Settings (AccessX)

Visual Settings and Themes

flast.indd xxxvi

flast.indd xxxvi 11/12/12 12:26 PM11/12/12 12:26 PM

(39)

Assistive Technology (ATs)

The following is a partial list of the used files, terms, and utilities: Sticky/Repeat Keys, Slow/Bounce/Toggle Keys, Mouse Keys, High Contrast/Large Print Desktop Themes, Screen Reader, Braille Display, Screen Magnifier, On-Screen Keyboard, Gestures (used at login, for example gdm), Orca, GOK, emacspeak

107 Administrative Tasks

107.1 Manage user and group accounts and related system files (Chapter 7)

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, groupadd, groupdel, groupmod, passwd, useradd, userdel, usermod

107.2 Automate system administration tasks by scheduling jobs (Chapter 9)

Manage cron and at jobs

Configure user access to cron and at services

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

107.3 Localization and internationalization (Chapter 6)

Locale settings

Timezone settings

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, tzconfig, date, iconv, UTF-8, ISO-8859, ASCII, Unicode

108 Essential System Services

108.1 Maintain system time (Chapter 7)

Set the system date and time

Set the hardware clock to the correct time in UTC

(40)

xxxviii Introduction

Configure the correct timezone

Basic NTP configuration

Knowledge of using the pool.ntp.org service

The following is a partial list of the used files, terms, and utilities: /usr/share/

zoneinfo, /etc/timezone, /etc/localtime, /etc/ntp.conf, date, hwclock, ntpd, ntpdate, pool.ntp.org

108.2 System logging (Chapter 7)

Syslog configuration files

syslog

standard facilities, priorities and actions

The following is a partial list of the used files, terms, and utilities: syslog.conf, syslogd, klogd, logger

108.3 Mail Transfer Agent (MTA) basics (Chapter 9)

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, send- mail emulation layer commands, newaliases, mail, mailq, postfix, sendmail, exim, qmail

108.4 Manage printers and printing (Chapter 6)

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)

109 Networking Fundamentals

109.1 Fundamentals of internet protocols (Chapter 8)

Demonstrate an understanding network masks

Knowledge of the differences between private and public “dotted quad” IP-Addresses

flast.indd xxxviii

flast.indd xxxviii 11/12/12 12:26 PM11/12/12 12:26 PM

(41)

Setting a default route

Knowledge about common TCP and UDP ports (20, 21, 22, 23, 25, 53, 80, 110, 119, 139, 143, 161, 443, 465, 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, ftp, telnet, host, ping, dig, traceroute, tracepath

109.2 Basic network configuration (Chapter 8)

Manually and automatically configure network interfaces

Basic TCP/IP host configuration

The following is a partial list of the used files, terms, and utilities: /etc/hostname, /etc/hosts, /etc/resolv.conf, /etc/nsswitch.conf, ifconfig, ifup, ifdown, route, ping

109.3 Basic network troubleshooting (Chapter 8)

Manually and automatically configure network interfaces and routing tables to include adding, starting, stopping, restarting, deleting or reconfiguring network interfaces

Change, view or configure the routing table and correct an improperly set default route manually

Debug problems associated with the network configuration

The following is a partial list of the used files, terms, and utilities: ifconfig, ifup, ifdown, route, host, hostname, dig, netstat, ping, traceroute

109.4 Configure client side DNS (Chapter 8)

Demonstrate the use of DNS on the local system

Modify the order in which name resolution is done

The following is a partial list of the used files, terms, and utilities: /etc/hosts, /etc/

resolv.conf, /etc/nsswitch.conf

110 Security

110.1 Perform security administration tasks (Chapter 10)

Audit a system to find files with the suid/sgid bit set

Set or change user passwords and password aging information

(42)

xl Introduction

Being able to use nmap and netstat to discover open ports on a system

Set up limits on user logins, processes and memory usage

Basic sudo configuration and usage

The following is a partial list of the used files, terms, and utilities: find, passwd, lsof, nmap, chage, netstat, sudo, /etc/sudoers, su, usermod, ulimit

110.2 Setup host security (Chapter 10)

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, /etc/inittab, /etc/init.d/*, /etc/hosts.allow, /etc/hosts.deny

110.3 Securing data with encryption (Chapter 10)

Perform basic OpenSSH 2 client configuration and usage

Understand the role of OpenSSH 2 server host keys

Perform basic GnuPG configuration and usage

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_dsa and id_dsa.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, ~/.ssh/authorized_keys, /etc/ssh_known_hosts, gpg, ~/.gnupg/*

flast.indd xl

flast.indd xl 11/12/12 12:26 PM11/12/12 12:26 PM

(43)

Assessment Test

1. The following line appears in your X server’s mouse configuration area. What can you conclude?

Option “Protocol” “PS/2”

A. The mouse is connected to the PS/2 hardware mouse port.

B. The mouse uses the PS/2 software communication standard.

C. The computer is an ancient IBM PS/2 system.

D. The mouse was designed for use with IBM’s OS/2.

E. A slash (/) is invalid in a protocol name, so the mouse won’t work.

2. How can you tell whether your system is using inetd or xinetd as a super server?

(Select two.)

A. Type ps ax | grep inetd, and examine the output for signs of inetd or xinetd.

B. Type superserver to see a report on which super server is running.

C. Look for the /etc/inetd.conf file or /etc/xinetd.d subdirectory, which are signs of inetd or xinetd, respectively.

D. Examine the /etc/inittab file to see which super server is launched by init, which is responsible for this task.

E. Type netstat -a | grep inet and examine the output for signs of inetd or xinetd.

3. How does the lpc utility for CUPS differ from its counterpart in BSD LPD and LPRng?

A. The lpc utility is unique to CUPS; it doesn’t ship with BSD LPD or LPRng.

B. CUPS doesn’t ship with an lpc command, but BSD LPD and LPRng do.

C. CUPS’s lpc is much more complex than its counterpart in BSD LPD and LPRng.

D. CUPS’s lpc is much simpler than its counterpart in BSD LPD and LPRng.

E. The lpc utility is identical in all three of these printing systems.

4. What file would you edit to restrict the number of simultaneous logins a user can employ?

A. /etc/pam.d/login-limits B. /etc/bashrc

C. /etc/security/limits.conf D. /etc/inittab

E. /etc/passwd

5. Which of the following are required when configuring a computer to use a static IP address? (Select two.)

A. The IP address of the DHCP server B. The hostname of the NBNS server

(44)

xlii Assessment Test

C. The computer’s IP address D. The network mask

E. The IP address of the NTP server

6. What does the following command accomplish?

$ wc report.txt | tee wc

A. It launches the wc editor on both the report.txt and wc.txt files; each file opens in its own window.

B. It displays a count of the windows in which the report.txt file is displayed and shows that information in a new window called wc.

C. It creates a count of newlines, words, and bytes in the report.txt file and then dis- plays a count of these statistics about the report it just generated.

D. It cleans up any memory leaks associated with the tee program’s use of the report .txt file.

E. It displays a count of newlines, words, and bytes in the report.txt file and copies that output to the wc file.

7. Which of the following characters defines the end of an OS or kernel definition in /boot/

grub/grub.cfg?

A. ; B. ) C. } D. */

E. None of the above; the definition ends with the title line beginning the next entry

8. What does the number 703 represent in the following /etc/passwd entry?

george:x:703:100:George Brown:/home/george:/bin/tcsh A. The account’s human ID (HID) number

B. The account’s process ID (PID) number C. The account’s group ID (GID) number

D. The account’s globally unique ID (GUID) number E. The account’s user ID (UID) number

9. What does the grep command accomplish?

A. It creates a pipeline between two programs.

B. It searches files’ contents for a pattern.

C. It concatenates two or more files.

D. It displays the last several lines of a file.

E. It locates files on the hard disk.

flast.indd xlii

flast.indd xlii 11/12/12 12:26 PM11/12/12 12:26 PM

(45)

10. Which of the following are journaling filesystems for Linux? (Select three.) A. HPFS

B. ReiserFS C. Ext2fs D. Ext3fs E. XFS

11. You’ve configured your computer to use SMTP and IMAP via a tunneled SSH connection to your ISP’s email server for improved security. Why might you still want to use GPG encryption for your emails on top of the encryption provided by SSH?

A. The SSH tunnel reaches only as far as the first email server; GPG encrypts data on all the computers all the way to or from your email correspondents.

B. SSH encryption is notoriously poor for email, although it’s perfectly adequate for login sessions; thus, adding GPG encryption improves security.

C. SSH doesn’t encrypt the headers of the email messages; GPG encrypts the headers to keep snoopers from learning your correspondents’ identities.

D. Using GPG guarantees that your email messages won’t contain unwanted viruses or worms that might infect your correspondents’ computers.

E. Configured in this way, SSH will encrypt the email headers and bodies, but not any attachments to your email.

12. Which of the following ports are commonly used to retrieve email from an email server computer? (Select two.)

A. 110 B. 119 C. 139 D. 143 E. 443

13. You’re experiencing sporadic problems with a Secure Shell (SSH) login server—sometimes users can log in, and sometimes they can’t. What might you try immediately after a failure to help diagnose this problem?

A. On the server computer, type http://localhost:631 into a Web browser to access the SSH configuration page and check its error subpage for error messages.

B. Type diagnose sshd to run a diagnostic on the SSH server daemon (sshd).

C. Type tail /var/log/messages to look for error messages from the server.

D. Examine the /dev/ssh device file to look for error messages from the server.

E. On the server computer, type sshd to view SSH’s diagnostic messages.

Références

Documents relatifs

Au choix parmi tous les exercices de la feuille : Exercices classiques sur les nombres réels.. Au choix parmi tous les exercices de la feuille : Exercices classiques sur

• Utilisation d’inégalités : théorème des gendarmes, théorème de comparaison pour montrer qu’une suite diverge, passage à la limite dans une inégalité lorsque l’on

With the interface circuit connected, each word command will light an LED or circuit, depending upon what’s connected to the output of the 4028 BCD-to-decimal decoder

Ils sont classés soit dans le dossier du client ou de la clientèle concernée (écoute des besoins), soit dans un dossier « Résultats clients » (évaluation de la satisfaction

— (a) Dans un plan euclidien P , les points int´erieurs (bord inclus) ` a un tri- angle, un carr´e ou une ellipse forment une partie convexe, de mˆeme que les points d’un disque..

— Dans la suite, on ne consid`erera que des vari´et´es alg´ebriques s´epar´ees, et l’on convient que d´esormais « vari´et´e alg´ebrique » signifie « vari´et´e

For more than 96˝ consult with experts at Trulite B = Sliding kit Maximum length of bars 144˝. For more than 96˝ consult the experts at Trulite Height of patch fitting

En aquesta ocasió, es va presentar un model de recerca en didàctica de les ciències socials, construït a partir d’algunes investigacions realitzades pel grup de treball