Table of Contents

Cover

Title Page

Credits

Copyright

Publisher's Note

Acknowledgments

About the Author

Table of Exercises

Introduction

Assessment Test

Answers to Assessment Test

Part I: The LPI 101 Exam (60 Weights)

Chapter 1: Exploring Linux Command-Line Tools

Understanding Command-Line Basics

Using Streams, Redirection, and Pipes

Processing Text Using Filters

Using Regular Expressions

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Chapter 2: Managing Software

Package Concepts

Using RPM

Using Debian Packages

Converting Between Package Formats

Package Dependencies and Conflicts

Managing Shared Libraries

Managing Processes

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Chapter 3: Configuring Hardware

Configuring the BIOS and Core Hardware

Configuring Expansion Cards

Configuring USB Devices

Configuring Hard Disks

Designing a Hard Disk Layout

Creating Partitions and Filesystems

Maintaining Filesystem Health

Mounting and Unmounting Filesystems

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Chapter 4: Managing Files

Managing Files

Managing File Ownership

Controlling Access to Files

Managing Disk Quotas

Locating Files

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Chapter 5: Booting Linux and Editing Files

Installing Boot Loaders

Understanding the Boot Process

Dealing with Runlevels and the Initialization Process

Editing Files with Vi

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Part II: The LPI 102 Exam (60 Weights)

Chapter 6: Configuring the X Window System, Localization, and Printing

Configuring Basic X Features

Configuring X Fonts

Managing GUI Logins

Using X for Remote Access

X Accessibility

Configuring Localization and Internationalization

Configuring Printing

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Chapter 7: Administering the System

Managing Users and Groups

Tuning User and System Environments

Using System Log Files

Maintaining the System Time

Running Jobs in the Future

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Chapter 8: Configuring Basic Networking

Understanding TCP/IP Networking

Understanding Network Addressing

Configuring Linux for a Local Network

Diagnosing Network Connections

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Chapter 9: Writing Scripts, Configuring E-mail, and Using Databases

Managing the Shell Environment

Writing Scripts

Managing E-mail

Managing Data with SQL

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Chapter 10: Securing Your System

Administering Network Security

Administering Local Security

Configuring SSH

Using GPG

Summary

Exam Essentials

Review Questions

Answers to Review Questions

Appendix A: About the Companion CD

What You’ll Find on the CD

System Requirements

Using the CD

Troubleshooting

Glossary

Index

End-User License Agreement

What's on the CD?

Perf Card - Objectives Map

Exam 101

Acquisitions Editor: Jeff Kellum

Development Editor: Kim Wimpsett

Technical Editors: Emmett Dulaney and Evan Blomquist

Production Editor: Christine O’Connor

Copy Editor: Tiffany Taylor

Production Manager: Tim Tate

Vice President and Executive Group Publisher: Richard Swadley

Vice President and Publisher: Neil Edde

Assistant Project Manager: Jenny Swisher

Associate Producer: Kit Malone

Quality Assurance: Angie Denny

Book Designer: Judy Fung, Bill Gibson

Compositor: Craig Woods, Happenstance Type-O-Rama

Proofreader: Publication Services, Inc.

Indexer: Ted Laux

Project Coordinator, Cover: Lynsey Stanford

Cover Designer: Ryan Sneed

Copyright © 2009 by Wiley Publishing, Inc., Indianapolis, Indiana

Published simultaneously in Canada

ISBN: 978-0-470-40483-6

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 also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.

Library of Congress Cataloging-in-Publication Data

Smith, Roderick W.

LPIC-1 : Linux Professional Institute Certification study guide / Roderick W. Smith. — 2nd ed.

p. cm.

ISBN 978-0-470-40483-6 (pbk. : CD-ROM)

1. Electronic data processing personnel—Certification. 2. Linux—Examinations—Study guides. I. Title.

QA76.3.S4773 2009

005.4’32—dc22

2009042577

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. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.

10 9 8 7 6 5 4 3 2 1

Dear Reader,

Thank you for choosing LPIC-1: Linux Professional Institute Certification Study Guide, Second 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 thirty 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 reflected 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, or 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

Acknowledgments

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. Kim Wimpsett, the Development Editor, and Christine O’Connor, the Production Editor, oversaw the book as it progressed through all its stages. Emmett Dulaney was the Technical Editor, who checked the text for technical errors and omissions—but any mistakes that remain are my own. Tiffany Taylor, the copy editor, helped keep the text grammatical and understandable. The proofreader, Publications Services, Inc., 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.

About the Author

Roderick W. Smith is a Linux consultant and author. He has written over a dozen books on Linux, FreeBSD, and computer networking, including the Linux+ Study Guide and Linux Administrator Street Smarts (both from Sybex). He can be reached at rodsmith@rodsbooks.com.

Table of Exercises

Exercise 1.1 Editing Commands

Exercise 2.1 Managing Packages Using RPM

Exercise 2.2 Managing Debian Packages

Exercise 3.1 Creating Filesystems

Exercise 4.1 Modifying Ownership and Permissions

Exercise 4.2 Locating Files

Exercise 5.1 Changing Runlevels

Exercise 6.1 Changing the X Resolution and Color Depth

Exercise 7.1 Creating User Accounts

Exercise 7.2 Creating User cron Jobs

Exercise 8.1 Configuring a Network Connection

Exercise 9.1 Changing Your bash Prompt

Exercise 9.2 Creating a Simple Script

Exercise 9.3 Creating a SQL Database

Exercise 10.1 Monitor Network Port Use

Introduction

Why should you learn about Linux? It’s a fast-growing operating system, and it is inexpensive and flexible. Linux is also a major player in the small and mid-sized server field, 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 if you’re looking for a promotion. For instance, this knowledge will help you to make an informed decision about if and when you should deploy Linux.

The Linux Professional Institute (LPI) has developed its LPI-1 certification as an introductory certification 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 troubleshoot a Linux system and is familiar with Linux-specific concepts and basic hardware.

The purpose of this book is to help you pass both of the LPI-1 exams (101 and 102). Because these exams cover basic Linux command-line tools, software management, hardware configuration, filesystems, the X Window System, the boot process, scripts, security, documentation, administration, and networking, those are the topics that are emphasized in this book. You’ll learn enough to manage a Linux system and how to configure it for many common tasks. Even after you’ve taken and passed the LPI 101 and 102 exams, this book should remain a useful reference.

This book has undergone its own testing and certification by ProCert (http://www.procertcom.com/labs_quicklinks/ql_latm.html). This means that you can rest assured that the book covers the LPI objectives.

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 scientific, engineering, and network 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 specific kernel with specific support programs.

Why Become LPI Certified?

Several good reasons to get your LPI certification exist. The LPI Web site suggests four major benefits:

Relevance LPI’s exam was 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 LPI exams have been extensively tested and validated using psychometric standards. The result is an ability to discriminate between competent administrators and those who must still learn more material.

Neutrality LPI is a nonprofit organization that does not 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 LPI exams are supported by major players in the Linux world. LPI serves the Linux community.

How to Become LPI Certified

The LPI certification is available to anyone who passes the test. You don’t have to work for a particular company. It’s not a secret society.

To take an LPI exam, you must first register with LPI to obtain an ID number. You can do this online at https://www.lpi.org/caf/Xamman/register. Your ID number will be e-mailed to you. With the ID number in hand, you can register for the exam with either of the two firms that administer them: Thomson Prometric and Pearson VUE. The exams can be taken at any Thomson Prometric or Pearson VUE testing center. If you pass, you will get a certificate in the mail saying that you have passed. To find the Thomson Prometric testing center nearest you, call (800) 294-3926. Contact (877) 619-2096 for Pearson VUE information. Alternatively, register online at http://securereg3.prometric.com for Thomson Prometric or http://www.vue.com/lpi/ for Pearson VUE. 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 LPI-1 exams may benefit from this book. If you’re new to Linux, this book covers the material you will need to learn the OS from the beginning, and it continues to provide the knowledge you need up to a proficiency level sufficient to pass the LPI-1 101 and 102 exams. You can pick up this book and learn from it even if you’ve never used Linux before, although you’ll find 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 to pass the LPI exam.

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 that you know some basics about computers in general, such as how to use a keyboard, how to insert a disc into a CD-ROM 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 fill 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. Although LPI topic 102 is titled “Linux Installation and Package Management,” neither the exam nor this book covers actually 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 now sell computers with Linux pre-installed.

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!