1082

Click here to load reader

Comptia Linux+ Certification Study Guide

Embed Size (px)

Citation preview

  • CompTIA Linux+ Certification Study Guide

    Robb H. Tracy

    New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto

    McGraw-Hill is an independent entity from CompTIA. This publication and CD-ROM may be used in assisting students to prepare for the CompTIA Linux+ exam. Neither CompTIA nor McGraw-Hill warrants that use of this publication and CD-ROM will ensure passing any exam.

  • Copyright 2008 by The McGraw-Hill Companies. All rights reserved. Manufactured in the United Statesof America. Except as permitted under the United States Copyright Act of 1976, no part of this publicationmay be reproduced or distributed in any form or by any means, or stored in a database or retrieval system,without the prior written permission of the publisher.

    0-07-159661-5

    The material in this eBook also appears in the print version of this title: 0-07-148874-X.

    All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after everyoccurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trade-mark owner, with no intention of infringement of the trademark. Where such designations appear in thisbook, they have been printed with initial caps.

    McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions,or for use in corporate training programs. For more information, please contact George Hoare, Special Sales,at [email protected] or (212) 904-4069.

    TERMS OF USE

    This is a copyrighted work and The McGraw-Hill Companies, Inc. (McGraw-Hill) and its licensorsreserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted underthe Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile,disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute,disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hills prior consent. Youmay use the work for your own noncommercial and personal use; any other use of the work is strictly pro-hibited. Your right to use the work may be terminated if you fail to comply with these terms.

    THE WORK IS PROVIDED AS IS. McGRAW-HILL AND ITS LICENSORS MAKE NO GUARAN-TEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF ORRESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THATCAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESS-LY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TOIMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meetyour requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licen-sors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in thework or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of anyinformation accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors beliable for any indirect, incidental, special, punitive, consequential or similar damages that result from the useof or inability to use the work, even if any of them has been advised of the possibility of such damages. Thislimitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in con-tract, tort or otherwise.

    DOI: 10.1036/007148874X

  • We hope you enjoy thisMcGraw-Hill eBook! If

    youd like more information about this book,its author, or related books and websites,please click here.

    Professional

    Want to learn more?

  • CompTIA Authorized Quality CurriculumThe logo of the CompTIA Authorized Quality Curriculum (CAQC) program and the status of this or other training material as Authorized under the CompTIA Authorized Quality Curriculum program signifies that, in CompTIAs opinion, such training material covers the content of CompTIAs related certification exam.

    The contents of this training material were created for the CompTIA Linux+ exam covering CompTIA certification objectives that were current as of June 2007. CompTIA has not reviewed or approved the accuracy of the contents of this training material and specifically disclaims any warranties of merchantability or fitness for a particular purpose. CompTIA makes no guarantee concerning the success of persons using any such Authorized or other training material in order to prepare for any CompTIA certification exam.

    How to Become CompTIA Certi edThis training material can help you prepare for and pass a related CompTIA certification exam or exams. In order to achieve CompTIA certification, you must register for and pass a CompTIA certification exam or exams.

    In order to become CompTIA certified, you must:

    1. Select a certification exam provider. For more information please visit www.comptia.org/certification/general_information/exam_locations.aspx.

    2. Register for and schedule a time to take the CompTIA certification exam(s) at a convenient location.

    3. Read and sign the Candidate Agreement, which will be presented at the time of the exam(s). The text of the Candidate Agreement can be found at www.comptia.org/certification/general_information/candidate_agreement.aspx.

    4. Take and pass the CompTIA certification exam(s).

    For more information about CompTIAs certifications, such as its industry acceptance, benefits, or program news, please visit www.comptia.org/certification.

    CompTIA is a not-for-profit information technology (IT) trade association. CompTIAs certifications are designed by subject matter experts from across the IT industry.

    Each CompTIA certification is vendor-neutral, covers multiple technologies, and requires demonstration of skills and knowledge widely sought after by the IT industry.

    To contact CompTIA with any questions or comments, please call (1) (630) 678-8300 or e-mail [email protected].

  • ABOUT THE AUTHOR

    Robb H. Tracy (CNA, CNE, CNI, A+, Network+, Linux+) has designed and implemented technical training products and curricula for major hardware and software vendors including Novell, Micron Technology, TestOut, Messaging Architects, Caselle, MoveNetworks, Makau, Cymphonix, and NextPage. Robb has also served on industry-wide certification committees, and is a co-founder of Nebo Technical Institute, Inc., a leading provider of information technology training and consulting. Robb is also the author of Novell Certified Linux Engineer (Novell CLE) Study Guide (Novell Press, 2005) and Novell Certified Linux Engineer 9 (CLE 9) Study Guide (Novell Press, 2006). Robb was also a contributing author to SUSE Linux 10 Unleashed (Sams Publishing, 2006).

    About the Technical EditorBrian Barber (Linux+, MCSE, MCSA, MCP+I, MCNE, CNE, CNA-GW) is a consultant with Sierra Systems Consultants Inc., specializing in IT service management and infrastructure architecture design and implementation. He first started using Linux at home with Red Hat 5.1 and since then he has been a staunch advocate of open source software, belonging to the Ottawa Canada Linux User Group (OCLUG) since 2001. His primary areas of interest are operating systems, multiplatform integration, directory services, and enterprise messaging. In the past he has held the positions of Senior Technical Analyst at MetLife Canada and Senior Technical Coordinator at the LGS Group Inc. (now a part of IBM Global Services). Brian was a contributing author to six books and the technical editor for three others.

    About LearnKeyLearnKey provides self-paced learning content and multimedia delivery solutions to enhance personal skills and business productivity. LearnKey claims the largest library of rich streaming-media training content that engages learners in dynamic media-rich instruction complete with video clips, audio, full motion graphics, and animated illustrations. LearnKey can be found on the Web at www.LearnKey.com.

  • This book is dedicated to all the individuals who have made a difference in my life. To my Dad, for instilling in me a love of teaching and all things

    mechanical. To my Mom, for teaching me the value of hard work and devotion. To my mentor, Dennis Simmons, for teaching me to strive for excellence

    in all I do. To my wife and best friend, for supporting and loving me through the process of writing this book.

  • vi

    CONTENTS AT A GLANCE

    1 Introducing Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    2 Working with PC Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    3 Installing Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    4 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

    5 Using Linux Text Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

    6 Managing the Linux File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263

    7 Working with Linux Users and Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

    8 Installing and Managing Software on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419

    9 Using the Linux Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473

    10 Managing Linux Processes and Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547

    11 Managing the Linux Boot Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609

    12 Configuring Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669

    13 Configuring Network Boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739

    14 Configuring Linux Network Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791

    15 Configuring Linux Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901

    16 Documenting and Troubleshooting the System . . . . . . . . . . . . . . . . . . . . . . . . . . 957

    Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1007

    About the CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027

  • viivii

    CONTENTS

    Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviiIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

    1 Introducing Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Describe the Background and History of Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    The Role and Function of Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3The Historical Development of Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Linux Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Common Linux Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    Use the Linux User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Using the Linux Command-Line Interface . . . . . . . . . . . . . . . . . . . . . . 16Exercise 1-1: Working with Linux Shells . . . . . . . . . . . . . . . . . . . . . 20Exercise 1-2: Using Linux Commands . . . . . . . . . . . . . . . . . . . . . . . . 27Using the Linux Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . 28

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    2 Working with PC Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45Describe Personal Computer Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    Power Supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Motherboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51System Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Expansion Slots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Storage Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    Describe Removable Hardware Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81Universal Serial Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82FireWire IEEE 1394 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84PCMCIA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

    For more information about this title, click here

  • viii Linux+ Certi cation Study Guide

    3 Installing Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99Plan a Linux Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    Conducting a Needs Assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105Selecting a Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110Verifying System Requirements and Hardware Compatibility . . . . 112Planning the File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118Selecting Software Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126Specify User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Gathering Network Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130Selecting an Installation Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

    Install Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140Exercise 3-1: Installing SUSE Linux . . . . . . . . . . . . . . . . . . . . . . . . . . 142

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

    4 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173Using man Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

    The man Directory Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177Manual Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179Using man to View Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179Exercise 4-1: Using man Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

    Using info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Using info to View System Documentation . . . . . . . . . . . . . . . . . . . . . 190Searching for Information in info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192Exercise 4-2: Using info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

    Using Other Documentation and Troubleshooting Resources . . . . . . . . . . 195Using README Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195Using Web-Based Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199Exercise 4-3: Using Web-Based Support Resources . . . . . . . . . 204

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

  • Contents ix

    5 Using Linux Text Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219Using Non-Graphical Linux Text Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

    Using the vi Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225Exercise 5-1: Using the vi Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234Using the Emacs Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236Exercise 5-2: Using the Emacs Editor . . . . . . . . . . . . . . . . . . . . . . . . . 241

    Using Graphical Text Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244Using Kate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245Using XEmacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247Using gedit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262

    6 Managing the Linux File System . . . . . . . . . . . . . . . . . . . . . . . . . . 263Describe the Linux File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265

    The Role of the Linux File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266The Hierarchical Structure of the Linux File System . . . . . . . . . . 266Types of Files Used by Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

    Complete Common File System Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274Navigating the File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275Exercise 6-1: Navigating the File System . . . . . . . . . . . . . . . . . . . . . 281Managing Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281Exercise 6-2: Managing Files and Directories . . . . . . . . . . . . . . . . 288Running Executables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289Searching the File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292Exercise 6-3: Using Linux Search Tools . . . . . . . . . . . . . . . . . . . . . . 297

    Manage Disk Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298Using fdisk to Create Disk Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298Building a File System with mkfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305Mounting a Partition with mount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306Checking the File System with fsck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310Exercise 6-4: Managing Linux Partitions . . . . . . . . . . . . . . . . . . . . . 312

    Use Removable Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314Working with Floppies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314Working with Optical Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

  • x Linux+ Certi cation Study Guide

    Working with USB and FireWire Devices . . . . . . . . . . . . . . . . . . . . . . . 317Exercise 6-5: Mounting Removable Media . . . . . . . . . . . . . . . . . . . 320

    Back Up Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320Selecting a Backup Medium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321Selecting a Backup Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322Using Linux Backup Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325Exercise 6-6: Backing Up Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

    7 Working with Linux Users and Groups . . . . . . . . . . . . . . . . . . 345Manage Users and Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349

    Linux User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349Exercise 7-1: Managing User Accounts from

    the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369Linux Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370Exercise 7-2: Managing Groups from the Command Line . . . . . 374

    Manage Ownership, Permissions, and Quotas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375Managing Ownership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375Exercise 7-3: Managing Ownership . . . . . . . . . . . . . . . . . . . . . . . . . . . 379Managing Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380Exercise 7-4: Managing Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . 387Exercise 7-5: Managing Default and Special Permissions . . . 393Implementing Disk Quotas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395Exercise 7-6: Establishing Disk Quotas . . . . . . . . . . . . . . . . . . . . . . . 401

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416

    8 Installing and Managing Software on Linux . . . . . . . . . . . . . 419Install Software on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421

    Obtaining Linux Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423Exercise 8-1: Using Web Resources to Obtain

    Linux Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429

  • Contents xi

    Installing Software from Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 430Exercise 8-2: Building Software from Source Code . . . . . . . . . . 440Installing Software Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441Exercise 8-3: Installing RPM Packages . . . . . . . . . . . . . . . . . . . . . . . 449

    Manage Installed Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449Uninstalling Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450Exercise 8-4: Uninstalling RPM Packages . . . . . . . . . . . . . . . . . . . . 453Updating Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453Querying Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453Verifying Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456Exercise 8-5: Managing RPM Packages . . . . . . . . . . . . . . . . . . . . . . . 459

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470

    9 Using the Linux Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473Use the Bourne Again Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475

    Reviewing the bash Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . 475Using Command History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479Exercise 9-1: Using Command History . . . . . . . . . . . . . . . . . . . . . . . 480Using Command Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481Exercise 9-2: Using Command Completion . . . . . . . . . . . . . . . . . 482

    Manage Linux Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483What Are Environment Variables? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483Managing Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487Exercise 9-3: Working with Environment Variables . . . . . . . . 494Creating a User-Defined Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494Creating Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496Exercise 9-4: Working with Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . 499

    Manage Shell Command Inputs and Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500Standard bash File Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500Redirecting Output and Input for Shell Commands . . . . . . . . . . . . 502Exercise 9-5: Redirecting Input and Output . . . . . . . . . . . . . . . . . 507Piping Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508Exercise 9-6: Using Pipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511Manipulating stdout Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512Exercise 9-7: Using awk and sed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517

  • xii Linux+ Certi cation Study Guide

    Create Shell Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518How Shell Scripts Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519Creating a Basic Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522Using Control Structures in Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527Exercise 9-8: Creating a Basic Shell Script . . . . . . . . . . . . . . . . . . . 532

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546

    10 Managing Linux Processes and Services . . . . . . . . . . . . . . . . . 547Describe How Linux Handles Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549

    What Exactly Is a Process? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549The Heredity of Linux Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553

    Manage Running Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557Starting System Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557Viewing Running Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560Prioritizing Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568Managing Foreground and Background Processes . . . . . . . . . . . . . . 573Ending a Running Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577Exercise 10-1: Working with Linux Processes . . . . . . . . . . . . . . . 579

    Schedule Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582Using the at Daemon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582Using the cron Daemon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586Exercise 10-2: Scheduling with Linux Processes . . . . . . . . . . . . . 593

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608

    11 Managing the Linux Boot Process . . . . . . . . . . . . . . . . . . . . . . . . 609Explain How the Linux Boot Process Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611

    The BIOS Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613The Bootloader Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615The Kernel Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616

    Configure Linux Bootloaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618Configuring LILO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619Configuring GRUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624

  • Contents xiii

    Exercise 11-1: Working with GRUB . . . . . . . . . . . . . . . . . . . . . . . . . 633Using a Bootloader to Create a Dual-Boot System . . . . . . . . . . . . . 634

    Manage Linux Runlevels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641How Runlevels Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642Managing Runlevels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648Exercise 11-2: Working with Linux Runlevels . . . . . . . . . . . . . . . 652

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668

    12 Configuring Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669Manage Hardware and Kernel Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671

    How Drivers Work Under Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671Managing Kernel Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676Exercise 12-1: Working with Kernel Modules . . . . . . . . . . . . . . . 683

    Configure Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684Power Management Implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . 685Configuring ACPI on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687Exercise 12-2: Working with Power Management Utilities . . . 693

    Burn CDs and DVDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694Burning Discs from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . 695Using Graphical Utilities to Burn Optical Discs . . . . . . . . . . . . . . . . 698Exercise 12-3: Burning CDs and DVDs . . . . . . . . . . . . . . . . . . . . . . 699

    Implement RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700An Introduction to RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701Configuring a RAID Array on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706Exercise 12-4: Creating a Software RAID Array . . . . . . . . . . . . 710

    Configure X Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712How the Linux GUI Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712Configuring the Graphical Environment . . . . . . . . . . . . . . . . . . . . . . . . 715

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737

  • xiv Linux+ Certi cation Study Guide

    13 Configuring Network Boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739Configure a Network Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741

    An Overview of the IP Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742Configuring an Ethernet Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750Exercise 13-1: Working with Network Interfaces . . . . . . . . . . . 759Configuring a Modem Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760

    Test and Monitor the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763Using ping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764Using netstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766Using traceroute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767Exercise 13-2: Working with Network Commands . . . . . . . . . . 770

    Configure Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770Configuring the Hardware for Routing . . . . . . . . . . . . . . . . . . . . . . . . . . 771Configuring the Linux Kernel to Support Routing . . . . . . . . . . . . . 773

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788

    14 Configuring Linux Network Services . . . . . . . . . . . . . . . . . . . . . 791Conf igure a DHCP Server on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793

    How DHCP Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794Configuring the dhcpd Daemon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796Exercise 14-1: Configuring a DHCP Server . . . . . . . . . . . . . . . . . . 800

    Configure a DNS Server on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802Exercise 14-2: Configuring a DNS Server . . . . . . . . . . . . . . . . . . . . 816

    Configure the Apache Web Server on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818How a Web Server Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818Installing the Apache Web Server Daemon . . . . . . . . . . . . . . . . . . . . . 821Exercise 14-3: Configuring a Web Server . . . . . . . . . . . . . . . . . . . . 826

    Configure Samba on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827How Samba Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827Installing the Samba Daemon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829 Configuring Samba . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830Exercise 14-4: Configuring Samba . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838

    Configure Printing on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839How Linux Printing Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840Installing CUPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842

  • Contents xv

    Configuring CUPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843Using the Line Printer Daemon (lpd) . . . . . . . . . . . . . . . . . . . . . . . . . . . 852Exercise 14-5: Configuring CUPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853

    Configure Basic Network Services with xinetd . . . . . . . . . . . . . . . . . . . . . . . . . . . 854How xinetd Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855Configuring xinetd Network Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856

    Configure NFS on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858How NFS Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858Exporting a Directory Using NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859Mounting an Exported Directory Using NFS . . . . . . . . . . . . . . . . . . . 860

    Use NIS on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862How NIS Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863Using NIS Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864

    Configure Remote Access on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865Configuring Telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865Configuring SSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867Using Remote Command-Line Utilities . . . . . . . . . . . . . . . . . . . . . . . . . 869Exercise 14-6: Configuring Remote Access . . . . . . . . . . . . . . . . . . 872

    Access Local E-Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873How E-Mail Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874Accessing Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876Exercise 14-7: Accessing Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898

    15 Configuring Linux Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901Secure the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903

    Securing the Physical Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903Securing Access to the Operating System . . . . . . . . . . . . . . . . . . . . . . . 905

    Control User Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907To root Or Not to root? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908Implementing a Strong Password Policy . . . . . . . . . . . . . . . . . . . . . . . . . 912Exercise 15-1: Controlling User Access . . . . . . . . . . . . . . . . . . . . . . 916

    Defend Against Network Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 918Mitigating Network Vulnerabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 918Using TCP Wrappers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 922

  • xvi Linux+ Certi cation Study Guide

    Using Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925Implementing a Firewall with iptables . . . . . . . . . . . . . . . . . . . . . . . . . . . 926Exercise 15-2: Implementing Network Security

    Measures on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 932Detect Intrusion Attempts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935

    Implementing Security Auditing with Tripwire . . . . . . . . . . . . . . . . . 940 Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946

    Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 954Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956

    16 Documenting and Troubleshooting the System . . . . . . . . 957Document the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958

    Documenting the System Configuration . . . . . . . . . . . . . . . . . . . . . . . . 960Documenting Changes and Maintenance . . . . . . . . . . . . . . . . . . . . . . . 962Using Standardized Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 962

    Troubleshoot System Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967Using a Standardized Troubleshooting Model . . . . . . . . . . . . . . . . . . . 967Creating a System Baseline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969Exercise 16-1: Generating a System Baseline . . . . . . . . . . . . . . . . 975Using Log Files to Troubleshoot Errors . . . . . . . . . . . . . . . . . . . . . . . . . . 976Troubleshooting Network and Hardware Issues . . . . . . . . . . . . . . . . . 987

    Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 998Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1002

    Lab Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1004Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1005Lab Answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1006

    Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1007

    About the CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027

  • xviixvii

    ACKNOWLEDGMENTS

    The title page of this book lists Robb H. Tracy as its author. However, this attribution is deceiving. By no means was this a one-person job. Behind every book is a team of people who rarely get the credit they deserve. They are the unsung heroes who make sure the job gets done.

    First, I would also like to acknowledge the efforts of the production team behind this book. These folks were the glue that kept everything together. Thanks to Timothy Green for giving me the opportunity to write this book. I appreciate your confidence in me! Thanks to Jennifer Housh for managing the development process. No matter the time of day, Jenni was always there with the information I needed. Thanks, Jenni!

    Finally, a huge thank you to Brian Barber. Brian reviewed each and every word and exercise step in this book for technical accuracy. His efforts kept me honest and were absolutely invaluable, dramatically increasing the overall quality of this title. Brian spent many late nights testing the lab exercises in this book, ensuring that you have a successful experience. Thanks, Brian!

  • This page intentionally left blank

  • xixxix

    INTRODUCTION

    Congratulations on your decision to become Linux+ certified! By purchasing this book, youve taken the first step toward earning one of the hottest certifications around. Being Linux+ certified provides you with a distinct advantage in todays IT job market. When you obtain your Linux+ certification, you prove to your employer, your co-workers, and to yourself that you truly know your stuff with Linux.

    This is a big issue. Over the years, Ive had the opportunity to interview a number of job applicants for open positions in my organization. I learned early on that you cant rely on the Skills and Knowledge section of an applicants rsum to get an accurate picture of what they can and cant do. Case in point: Back in the late 1990s my group had a position open that required an exceptionally strong background in computer hardware and networking. The job posting listed extensive background with computers and networking as one of the requirements for the position.

    One of the candidates I interviewed claimed in her rsum to have an extensive background in these areas. In fact, during the interview she claimed to be an expert in the field. I have to admit, her rsum did look impressive.

    However, as the interview progressed I began to have some doubts. This person just didnt speak or act like a true techie, so I decided to give a little test. I asked her to connect an Iomega Jazz drive to the external SCSI port on a workstation. A pretty easy task for an expert, right? Well, she couldnt do it. In fact, she didnt even know where to begin.

    To make a long story short, upper management eventually hired this applicant in spite of my objections. It wasnt a good situation. She didnt have the background required and subsequently performed very poorly on the job and eventually quit after only a year. The key problem in this situation was conflicting definitions of a computer and networking expert. We define this as someone who could install expansion cards, hard drives, and operating systems as well as set up a computer network.

    This applicant, on the other hand, had a very different definition. She considered herself to be an expert because she knew how to use Microsoft Word, Excel, and PowerPoint. She also knew how to log into a network using her username and password. In essence, she was an expert end user, but she was not an expert system administrator, which was what we were looking for.

  • xx Linux+ Certi cation Study Guide

    All this could have been avoided if my company had listed specific certifications in the job requirements instead of just asking for an extensive background with computers and networking. Certifications help everyone involved in the hiring process. By requiring Linux+ certification, prospective employers can weed out applicants who really dont have the skills and knowledge required for a particular position. Having your Linux+ certification also helps you demonstrate to potential employers that you truly have the Linux background you claim on your rsum, giving you an advantage over other job applicants who arent certified.

    With this in mind, we need to introduce you to this book and the Linux+ certification program. Well cover the following topics:

    Who this book is for How this book is organized The Linux+ certification exam Tips for succeeding on the Linux+ certification exam

    Lets begin by discussing whom this book is for.

    Who This Book Is ForBefore you start this book, you need to be aware that I have two primary goals in mind as I write:

    To help you prepare for and pass the Linux+ exam offered by CompTIA. To provide you with the extra skills and knowledge you need to be successful

    on the job after you are certified.

    Essentially, when were done here I want you to be able to do more than just recite facts. I want you to be able to walk the walk and talk the talk. I want you to be able to actually do the job once hired.

    To accomplish this, were going to focus heavily on the core Linux knowledge and skills in this book required by the Linux+ certification. That means you need to already have a strong computing background before starting. You need to have a strong set of basic computer skills, such as:

    Knowing how to power your system off and on Knowing how to use a mouse and keyboard Knowing how to use end-user applications, such as word processors,

    spreadsheets, Web browsers, and e-mail clients

  • Introduction xxi

    In addition to these skills, you also need to be very familiar with computer hardware and basic networking concepts and technologies. As we progress through this book, Ill try to provide background information where needed, but Im going to assume that you already know your stuff with PC hardware and computer networking. You should be familiar with the following:

    PC cases and power supplies Motherboards Expansion slots and expansion boards CPUs and memory Storage devices such as hard drives, floppy drives, and optical drives Video boards and monitors Peripheral devices such as printers, scanners, and digital cameras Basic networking principles Common networking topologies (such as the star, bus, and ring) Common networking components such as NICs, cables, routers, and hubs/

    switches

    Common networking protocols (such as IP, IPX, TCP, UDP, and NetBIOS) Common networking services, such as FTP servers, Web servers, and mail

    servers

    If possible, I strongly recommend that you have your A+ certification and your Network+ certification under your belt (or have equivalent experience in the field) before starting this book. These two certification programs will provide you with the hardware and networking background you need to be successful in your Linux+ certification program.

    If you have this background, youre ready to roll! Lets next discuss how this book is organized to accomplish its two main goals.

    How This Book Is OrganizedI love CompTIA certification programs. They go the extra mile to make sure their certifications truly reflect current trends in the information technology industry, and the Linux+ certification is no exception. They define their certification programs by publishing objectives that list the skills and knowledge that a certified person should have.

  • xxii Linux+ Certi cation Study Guide

    However, these objectives, as currently published, are organized by topic. They arent organized into a logical instructional flow. As you read through this book, youll quickly notice that I dont address the Linux+ objectives in the same order as they are published by CompTIA. All of the objectives are covered; however, Ive reorganized them such that we start with the most basic Linux concepts first. Then, as we progress through the course, well address increasingly more advanced Linux+ objectives, building upon the skills and knowledge covered in preceding chapters.

    In addition, Ive included information to emphasize important points, supply real-world examples, and provide tips for taking the Linux+ exam. Each chapter contains the following:

    Certification Objectives Each chapter begins with a list of Linux+ objectives that will be covered in the chapter. After completing each chapter, you should revisit the list of certification objectives and ask yourself Can I actually do that now?

    Exam Watch Exam Watch notes point out gotchas to watch for on the Linux+ exam. While I cant legally disclose exact questions from the exam, I can emphasize key concepts and skills that you should pay special attention to.

    Certification Exercises Each chapter has one or more certification exercises. Just about anyone can memorize a bunch of facts and pass an exam. This isnt enough for me. I would consider myself a failure as an instructor if thats all you could do after reading this book. Instead, I want you to be able to actually perform the tasks we cover in each chapter.

    To accomplish this, Ive included many hands-on exercises in the book that will help you practice the skills and knowledge presented in the text. Dont pass over these exercises! If you want to do well on your Linux+ exam and perform well on the job, you need to practice. The more you practice the longer you will retain your newfound Linux knowledge.

    On the Job In addition to certification exercises, Ive also included On the Job notes throughout each chapter. The goal is to provide you with knowledge beyond that which is required to pass the Linux+ exam. Ive worked in the IT industry for a long time and I try to share real-world tips, tricks, and experiences that Ive learned over the years in these notes.

    Scenario & Solution Each chapter also includes Scenario & Solution tables that present you with hypothetical scenarios and ask you to determine the correct way to address them. These also help you advance your knowledge and skills from the pass the exam level to the perform well on the job level.

  • Introduction xxiii

    Certification Summary At the end of each chapter, you will find a Certification Summary section that will review the key concepts and skills covered in the chapter.

    Two-Minute Drill In addition to the Certification Summary, you will also find a Two-Minute Drill at the end of each chapter that contains a list of the most salient points from the chapter. This is an excellent review tool that you can use to prepare for your Linux+ exam.

    Self Test Each chapter includes a Self Test that you can use to prepare for your Linux+ exam. The Self Test contains test items that are similar to those found on the actual exam.

    Lab Questions A key aspect of moving from the memorization learning level to the application learning level is the ability to synthesize multiple ideas and skills together and apply them to an unencountered situation. Thats the

    role of the Lab Question at the end of each Self Test. In the Lab Question, you are presented with a hypothetical scenario. To solve the problem presented, you must design a solution using multiple concepts and skills that will work together correctly. Be warned that the Lab Questions are intentionally difficult. Again, my goal is to help you pass the Linux+ exam and be proficient on the job. If you can correctly solve the Lab Questions, then you are on your way!

    Once youve finished reading this book, you should take some time to meditate on and synthesize what youve learned. The reason for doing this is that the human brain has two main memory areas:

    Short-term memory Long-term memory

    When taking the Self Tests, you should record your answers on a separate piece of paper. This will allow you to go through the items multiple times as you prepare for your Linux+ exam without giving away the correct answer.

    Q&A

    SCENARIO & SOLUTIONYoure installing a Linux system that will function as a Web application server. Which packages should you install?

    To provide Web application services, you will need Apache Web server, Tomcat servlet container, and a database application such as MySQL.

  • xxiv Linux+ Certi cation Study Guide

    When you read this book, the information is first stored in your short-term memory. Your short-term memory is much like the cache on your PCs CPU. Its really fast, providing you with instant access to the information it contains. However, its also very small. It just doesnt hold very much. The average person can only store between five and nine pieces of information in their short-term memory at a time.

    When your short-term memory is full and new information needs to be loaded, one of two things happens:

    The existing information gets moved into your brains long-term memory. The information gets dumped.

    Obviously, you want the former and not the latter. The key to making this happen is meditation, practice, and application. If you just read this book, you probably wont remember many specific details when youre done. If you read this book and meditate about what youve read, you will remember many more details. Meditation gives your brain a chance to move information from your short-term memory into your long-term memory.

    If you read this book, meditate on what youve learned, and then practice the skills and concepts you learned, using the Self Tests and Certification Exercises, you will retain considerably more. When you practice, you exercise your brain, making it easier to find and recall the information from your long-term memory. Then, if you take what you know and apply it to an unencountered circumstance in the real world, you ensure that the information is retained for a very long period of time.

    The point is, dont just read this book and expect to remember everything. Utilize the resources included in this book to help reinforce the ideas and skills you learn. Later in this Introduction, well discuss test-preparation and test-taking strategies in more depth.

    With this in mind, lets now spend some time familiarizing you with the Linux+ certification exam.

    The Linux+ Certification ExamNow that you understand how this book is organized, its time for you to become familiar with the Linux+ certification program and its associated exam. You need to know the following:

    About the Linux+ certification Taking the Linux+ exam Exam makeup

  • Introduction xxv

    About the Linux+ Certi cationThe Linux+ certification is an excellent program! Linux+ is a vendor-neutral certification designed and administered by the Computing Technology Industry Association, affectionately known as CompTIA. Its considered vendor-neutral because the exam isnt based on one particular vendors hardware or software. This is somewhat unique in the information technology industry. Many IT certification programs are centered on one particular vendors hardware or software, such as Microsofts Certified System Engineer (MCSE) certification, Novells Certified Novell Engineer (CNE) certification, or Red Hats Certified Engineer (RHCE) certification.

    The Linux+ certification, on the other hand, is designed to verify your knowledge and skills with the Linux operating system in general, not on any one particular distribution. According to CompTIA:

    Professionals holding the CompTIA Linux+ credential can explain fundamental management of Linux systems from the command line, demonstrate knowledge of user administration, understand file permissions, software configurations, and management of Linux-based clients, server systems, and security.

    To verify your knowledge, CompTIA requires you to take the Linux+ exam to earn your certification. By passing this exam, you demonstrate that you have the skills and knowledge equivalent to a Linux system administrator who has 612 months of on-the-job experience.

    CompTIA has published a set of objectives that define the Linux+ certification. These objectives specify what a Linux system admin with 612 months of experience should know and be able to do. You can view the Linux+ objectives at http://certification.comptia.org/linux/. All of the test items on the Linux+ exam are based on these objectives.

    To define the Linux+ objectives, CompTIA organized a volunteer committee made up of representatives from the IT industry occupying a variety of positions in their respective organizations. They then asked these individuals What does a Linux administrator with 612 months of experience have to know and be able to do to be effective on the job? Using the responses from the committee members, CompTIA was able to craft a profile that they used to write a series of objectives. Some sample Linux+ objectives include

    Configure file systems (for example, ext2 or ext3 or Reiser file system). Manage packages after installing the operating system (for example, install,

    uninstall, update, RPM, tar, gzip).

    Select appropriate parameters for a Linux installation (for example, language, time zones, keyboard, mouse).

  • xxvi Linux+ Certi cation Study Guide

    If youre going to be Linux+ certified, then you have to be able to do the tasks contained in these objectives. As we go through this book, youll see that the complete list of Linux+ objectives is quite extensive. I love Linux+!

    Lets now talk about the exam itself.

    Taking the Linux+ ExamThe Linux+ exam is a timed exam that is delivered electronically on a computer. Its composed of 98 questions that you will have 90 minutes to complete. The exam interface is fairly straightforward. Each item is displayed one at a time on the screen, as shown in Figure I-1.

    As you can see in Figure I-1, the Linux+ exam presents you with a question along with a series of responses. You use the mouse to mark the appropriate response and then select Next to go to the next question. If you need to go back to a prior question, select Previous.

    The exam is composed of several types of questions:

    Multiple Choice The multiple-choice question format presents you with a question and asks you to mark the correct answer from a list of choices. The bulk of the questions on the Linux+ exam are multiple-choice questions.

    Most multiple-choice questions require only one answer; some will require you to select multiple correct responses from the list displayed. If this is the case, the test question will end with the text (Choose x.) where x is the number of responses you should mark.

    If you run into a particularly dif cult question on the exam, dont spend too much time on it! Ive known numerous students who have fallen into this trap. They encounter a very hard question on the exam and become obsessed with nding the answer. They accomplish the task, but burn up so

    much time in the process that they cant complete the rest of the exam.

    If you run into a really dif cult question on your Linux+ exam, skip it and move on. After you have nished the rest of the test, come back to your skipped questions and use the remainder of your exam time to gure them out.

  • Introduction xxvii

    Exhibit The exhibit question is a variation on the multiple-choice question type. In an exhibit question, you are presented with an Exhibit button. When you click it, a diagram, image, or scenario is displayed on the screen. You use the information in the exhibit to determine the correct answer to the multiple-choice question in the item.

    Point and Click Point and click questions display an image on the screen along with a question about the image. You then click on the appropriate location on the image to answer the question.

    After you complete your exam, the computer will immediately evaluate it and your score will be printed out. To pass, you need a minimum score of 675 points out of a possible 900. Hopefully, you will pass your exam on the first try. However, if you dont, your score printout will list the objectives where you missed questions. You can use this information to review and prepare yourself to retake the exam. Well discuss this in more detail later in this Introduction.

    To make the exam globally available, CompTIA administers the Linux+ exam through two testing partners:

    Thompson Prometric www.prometric.com/default.htm Pearson VUE www.vue.com/

    To sign up for your Linux+ exam, choose one of these testing partners and visit their Web site. There you will find a link that will help you locate a testing center near you. Most community and technical colleges are authorized testing centers.

    FIGURE I-1 The Linux+ exam interface

  • xxviii Linux+ Certi cation Study Guide

    Just specify the exam you want to take and your locale information. You will then be provided with a list of testing centers near you, as shown in Figure I-2.

    You can then use the Prometric or the VUE Web site to schedule your exam and pay your fees. You can also call either provider directly and schedule your exam over the phone. Be aware that they will need to verify your identity before they can sign you up, so be prepared to share your Social Security number when you call or log on. The test provider will send you a confirmation e-mail listing the date, time, and location of your exam.

    On the day of the test, be sure you allow adequate travel time. You never know when you will run into a traffic jam. In addition, you should try to show up early enough to find a parking spot and walk to the testing center. If youre taking your exam at a community college or a trade school, you may find that you have to walk a very long distance to get from the parking lot to the building where the exam is delivered. The last thing you need right before your exam is to feel rushed and stressed!

    FIGURE I-2 Locating a testing center near you

  • Introduction xxix

    When you check in at the testing center, you will be required to show two forms of identification, one of which must have your photo on it. The following are acceptable forms of ID:

    Drivers license Social Security card Credit card Student ID card Military ID card State-issued ID card

    Be warned that, when you check in, you must surrender your cell phone, iPod, PDA, laptop, or any other electronic devices to the test proctor. Youre not allowed to take any reference materials into the exam room, including blank paper. Most testing centers will provide you with note-taking materials that must remain in the room where the test is being administered. Some testing centers will provide you with paper and a pencil; others may provide a small whiteboard slate with an erasable pen.

    Lets now look at the composition of the Linux+ exam itself.

    Exam MakeupThe Linux+ certification is composed of a single exam containing 98 questions. The exam is divided up into six categories, which CompTIA calls domains. These are shown in Table I-1.

    As you can see in the table, some domains are tested more heavily than others. When studying, be sure to pay special attention to those domains with the highest percentage of exam questions!

    With this in mind, lets now discuss how to prepare for the Linux+ exam.

    TABLE I-1

    Linux+ Domains

    Domain Percentage of Exam Questions

    Installation 19 percent

    Management 26 percent

    Configuration 20 percent

    Security 21 percent

    Documentation 6 percent

    Hardware 8 percent

  • xxx Linux+ Certi cation Study Guide

    Tips for Succeeding on the Linux+ Certification Exam

    Ill never forget the first time I took an IT certification exam back in the early 1990s. I was so nervous that I almost couldnt function. Fortunately, the exam went very well and I passed it handily. Over the last decade, Ive helped a number of individuals prepare themselves for a variety of certification exams. Ive even written a number of industry certification exams myself. As a result, Ive learned a number of things that you can do to increase the likelihood that you will pass your exam. Well discuss the following here:

    Preparing for the exam Taking the exam

    Lets begin by learning how you can prepare yourself for the Linux+ exam.

    Preparing for the ExamThe most important thing you can do to prepare for your Linux+ exam is to thoroughly study. No tip, no trick, no strategy can compensate for a lack of study. Remember, the goal is to move the information you need to pass the exam into your long-term memory. Following are some suggestions for studying that can help you prepare for your certification exam.

    One to Two Months Before Your Exam

    Schedule your Linux+ exam. Ideally, you should schedule it to take place about 3060 days after you begin this book. If you dont give yourself a deadline, you probably will never get around to studying for and taking the exam.

    Pace yourself. Dont try to cram for the exam the night before. This is a very common mistake made by many students. (I did this myself in college.) Cramming rarely works because your short-term memory can only hold a limited amount of information. All that stuff youre trying to cram into your short-term memory gets lost. Instead, successful test-takers spend a good deal of time loading information into their long-term memory. You can do this by setting a goal to read a certain number of pages or chapters each day and sticking to it.

  • Introduction xxxi

    Take notes! As you read each chapter, write down important information that stands out to you. Writing this down helps reinforce the information, moving it from short-term memory into long-term memory in your brain. It also provides you with a valuable review resource.

    Do the lab exercises, even the simple ones. Doing the lab exercises helps you learn the practical implementation of the conceptual skills and knowledge presented in each chapter.

    Take the Self Tests at the end of each chapter. After you read a chapter, get a blank piece of paper and run through the Self Test, recording your responses on the paper. (Dont write in the book!) Check your answers and review the topics you missed.

    Review the Certification Summary and Two-Minute Drill after you complete each chapter.

    Two to Three Days Before Your Exam

    Review your notes. Retake the Self Tests at the end of each chapter. Review any topics that you

    are still struggling with.

    Repeat the lab exercises for each chapter. This time, however, try to complete the exercises without looking at the steps in the book.

    The Night Before Your Exam

    Relax! Being well rested is a key to performing well on your exam. Dont get so worked up and nervous that you cant sleep the night before your exam. Get to bed at a reasonable hour.

    Review your notes. Review the Certification Summary and Two-Minute Drill again for each

    chapter. Repetition is the key to retention!

    The Morning of Your Exam

    Eat a good breakfast. Your brain requires a tremendous amount of calories to operate. Give it what it needs!

    Review your notes.

  • xxxii Linux+ Certi cation Study Guide

    Review the Certification Summary and Two-Minute Drill once again for each chapter. Did I mention that repetition is the key to retention?

    Retake the Self Tests one more time at the end of each chapter. Allow yourself plenty of time to get to the testing center. Dont get stressed

    out by being late.

    What were trying to do in this process is upload the information you need to pass your test into your long-term memory through repetition and practice. Then, shortly before the exam, were exercising the brain by retrieving that stored information and bringing it to the forefront of your thoughts (kind of like loading data from a hard drive into system RAM) so that it is ready and available when you take the test.

    Next, lets talk about some strategies you should keep in mind when actually taking the exam.

    Taking the ExamAs I mentioned earlier, Ive written a number of industry certification exams in addition to developing training materials for them. Because Ive done this, I have some insights as to what goes on inside the devious minds of test item writers. Im going to share them with you here:

    Carefully read the text of each question (called the stem). Some of the information in the stem is superfluous and intended to distract you. However, the question stem usually contains one or two critical pieces of information that influence the correct answer. If your testing center provides you with writing materials (and they should), I suggest you quickly jot down the key points from the stem.

    Carefully read each response. Dont just skim them. Test item authors deliberately include responses that are almost correct, but not quite. (We call them red herrings.) The intent is to distract you away from the real answer. I know it sounds sneaky, but the intent is to make the exam such that you cant divine the correct answer without really knowing your stuff.

    Eliminate responses that are obviously wrong. Each item will have one or more responses that are blatantly wrong. (Usually its because the test author couldnt think of anything better to include as a response.) Eliminate these answers and focus only on the responses that could be correct.

    Make your best choice and move on. My experience has been that your first impression is usually the correct one. If you agonize over the answers, you can over-think the question and end up picking the wrong response. You also

  • Introduction xxxiii

    waste valuable time. After carefully reading the question and each response, go with your intuition and then go on to the next item.

    If you get stuck on a particularly difficult item, dont waste a lot of time trying to figure out the right answer. You can skip the item and come back to it later. Many students get obsessed with finding the right answer to a particularly difficult question and end up with insufficient time to answer the rest of the items on the exam. Answer the questions that you can and then come back to the difficult questions that will require more time.

    After you finish your exam, your results will be automatically printed out for you. The report will be embossed by your test proctor to certify the results. Dont lose your report; its the only hard copy you will receive. Ive heard of many candidates who had to send a copy of their test report back to the testing company when technical problems prevented their test results from being recorded correctly.

    The report will display your performance on each section of the exam. The Linux+ exam is a pass-fail exam. If you score 675 or better, you pass! A candidate with a score of 677 is every bit as certified as a candidate with a score of 898.

    If you didnt pass, you can use the information on your report to identify the areas where you need to study. You can retake the exam immediately, if you wish. However, there are two things you need to keep in mind before you do this:

    You have to pay full price for the retake. The second exam probably wont be the same as the first. CompTIA

    publishes multiple forms of the Linux+ exam. You could actually score worse on the second exam than on the first.

    If you fail, I suggest that you step back, take a deep breath, go home, and study up on the items you missed. Then schedule your retake within a day or two. If you wait

    any longer than that, your mind will probably go cold and you may need to go through the entire preparation process again from scratch.

    Basically, youre better off if you pass the first time. It can be done if you properly prepare yourself. Ive personally taken around 20 IT certification exams and Ive always passed on the first try. If you follow the advice Ive given you here, you should be well prepared for your Linux+ exam.

    If you dont pass, you can retake the Linux+ exam as soon as you want, even the same day. However, if you dont pass again, you must wait at least 30 days before you will be allowed to take the exam a third time.

  • xxxiv Linux+ Certi cation Study Guide

    Exam XK0-002

    Exam Readiness Checklist

    Beg

    inne

    r

    Inte

    rmed

    iate

    Exp

    ert

    Official Objective Study Guide Coverage Ch # Pg #

    Installation (1.0)

    Identify all system hardware required (for example, CPU, memory, drive space, scalability) and check compatibility with Linux distribution (1.1)

    Installing Linux 3 113

    Determine appropriate method of installation based on environment (for example, boot disk, CD-ROM, network (HTTP, FTP, NFS, SMB)) (1.2)

    Installing Linux 3 134

    Install multimedia options (for example, video, sound, codecs) (1.3)

    Configuring Hardware 12 671

    Identify purpose of Linux machine based on predetermined customer requirements (for example, appliance, desktop system, database, mail server, Web server, etc.) (1.4)

    Introducing LinuxInstalling Linux

    13

    12103

    Determine what software and services should be installed (for example, client applications for workstation, server services for desired task) (1.5)

    Installing Linux 3 126

    Partition according to pre-installation plan using fdisk (for example, /boot, /usr, /var, /home, swap, RAID/volume, hot-spare, lvm) (1.6)

    Installing Linux 3 118

    Configure file systems (for example, ext2 or ext3 or Reiser) (1.7)

    Installing Linux 3 119

    Configure a boot manager (for example, LILO, ELILO, GRUB, multiple boot options) (1.8)

    Managing the Linux Boot Process

    11 618

    Manage packages after installing the operating systems (for example, install, uninstall, update, RPM, tar, gzip) (1.9)

    Installing and Managing Software on Linux

    8 421

  • Introduction xxxv

    Exam Readiness Checklist

    Beg

    inne

    r

    Inte

    rmed

    iate

    Exp

    ert

    Official Objective Study Guide Coverage Ch # Pg #

    Select appropriate networking configuration and protocols (for example, inetd, xinetd, modems, Ethernet) (1.10)

    Configuring Network Boards

    13 750

    Select appropriate parameters for Linux installation (for example, language, time zones, keyboard, mouse) (1.11)

    Installing Linux 3 142

    Configure peripherals as necessary (for example, printer, scanner, modem) (1.12)

    Configuring Hardware 12 839

    Management (2.0)

    Manage local storage devices and file systems (for example, fsck, fdisk, mkfs) using CLI commands (2.1)

    Managing the Linux File System

    6 298

    Mount and unmount varied file systems (for example, Samba, NFS) using CLI commands (2.2)

    Managing the Linux File System

    6 307

    Create files and directories and modify files using CLI commands (2.3)

    Managing the Linux File System

    6 281

    Execute content and directory searches using find and grep (2.4)

    Managing the Linux File System

    6 292

    Create linked files using CLI commands (2.5)

    Managing the Linux File System

    6 287

    Modify file and directory permissions and ownership (for example, chmod, chown, sticky bit, octal permissions, chgrp) using CLI commands (2.6)

    Working with Linux Users and Groups

    7 380

    Identify and modify default permissions for files and directories (for example, umask) using CLI commands (2.7)

    Working with Linux Users and Groups

    7 388

    Perform and verify backups and restores (tar, cpio) (2.8)

    Managing the Linux File System

    6 320

  • xxxvi Linux+ Certi cation Study Guide

    Exam Readiness Checklist

    Beg

    inne

    r

    Inte

    rmed

    iate

    Exp

    ert

    Official Objective Study Guide Coverage Ch # Pg #

    Access and write data to recordable media (for example, CD RW, hard drive, flash memory devices) (2.9)

    Configuring Hardware 12 314

    Manage runlevels and system initialization from the CLI and configuration files (for example, /etc/inittab and init command, /etc/rc.d, rc.local) (2.10)

    Managing the Linux Boot Process

    11 641

    Identify, execute, manage, and kill processes (for example, ps, kill, killall, bg, fg, jobs, nice, renice, rc) (2.11)

    Managing Linux Processes and Services

    10 549

    Differentiate core processes from non-critical services (for example, init, [kernel processes], PID, and PPID values) (2.12)

    Managing Linux Processes and Services

    10 554

    Repair packages and scripts (for example, resolving dependencies, repairing, installing, updating applications) (2.13)

    Installing and Managing Softwa