Linux Timesaving Techniques For Dummies

  • View
    265

  • Download
    25

Embed Size (px)

Transcript

  • LinuxTimesavingTechniques

    FOR

    DUMmIES

    by Susan Douglas and Korry Douglas

    01a_571737ffirs.qxd 7/2/04 7:55 PM Page i

  • 01a_571737ffirs.qxd 7/2/04 7:55 PM Page i

  • LinuxTimesavingTechniques

    FOR

    DUMmIES

    by Susan Douglas and Korry Douglas

    01a_571737ffirs.qxd 7/2/04 7:55 PM Page i

  • Linux Timesaving Techniques For Dummies

    Published byWiley Publishing, Inc.111 River StreetHoboken, NJ 07030-5774

    Copyright 2004 by Wiley Publishing, Inc., Indianapolis, Indiana

    Published by Wiley Publishing, Inc., Indianapolis, Indiana

    Published simultaneously in Canada

    No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by anymeans, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted underSections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of thePublisher, 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 per-mission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd.,Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, e-mail: brandreview@wiley.com.

    Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the Rest ofUs!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, and related trade dress are trade-marks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and othercountries, and may not be used without written permission. All other trademarks are the property of theirrespective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.

    LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTA-TIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THISWORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FIT-NESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMO-TIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERYSITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN REN-DERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE ISREQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUB-LISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANI-ZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OFFURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMA-TION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READ-ERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED ORDISAPPEARED 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 ourCustomer Care Department within the U.S. at 800-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 beavailable in electronic books.

    Library of Congress Control Number: 2004101962

    ISBN: 0-7645-7173-7

    Manufactured in the United States of America

    10 9 8 7 6 5 4 3 2 1

    1V/SR/QX/QU/IN

    01a_571737ffirs.qxd 7/2/04 7:55 PM Page ii

  • About the AuthorsSusan Douglas is the CEO of Conjectrix, Inc., a software consulting firm specializing indatabase- and security-related issues. When shes not busy at the computer, Susan isprobably throwing pottery, glassblowing, or horseback riding.

    Korry Douglas is the Director of Research and Development for Appx Software. Whenhes not working on computers, hes making elegant sawdust in the woodshop.

    Together, they are the coauthors of Red Hat Linux Fedora Desktop For Dummies andPostgreSQL.

    Susan and Korry enjoy life on a farm in rural Virginia where they raise horses and smalllivestock. They both telecommute, so they have more time to spend with their 200 or soanimal friends. If theyre not at home, theyre out riding roller coasters.

    Authors AcknowledgmentsWe would like to thank all the staff at Wiley who have supported this project, from startto finish. Without the help and direction of Terri Varveris, organizing this book wouldhave been an impossible task. Becky Huehlss editorial help and guidance have kept thisproject rolling along on schedule (fairly painlessly, we might add). We also want toextend a big thanks to the technical editors whove kept us honest throughout thecourse of the book.

    Thanks go also to all the supporting staff at Wiley that weve never met. We know youreout there, and we appreciate your efforts and support.

    Thank you also to all the programmers and developers that make open-source softwaresuch an interesting, productive, and fun environment to work in.

    01a_571737ffirs.qxd 7/2/04 7:55 PM Page iii

  • CompositionProject Coordinator: Barbara Moore

    Layout and Graphics: Lauren Goddard, Denny Hager,Stephanie D. Jumper, Michael Kruzil, Lynsey Osborn,Jacque Schneider

    Proofreaders: Laura Albert, Vicki Broyles,Brian H. Walls

    Indexer: Steve Rath

    Acquisitions, Editorial, and Media DevelopmentAssociate Project Editor: Rebecca Huehls

    Acquisitions Editor: Terri Varveris

    Senior Copy Editor: Kim Darosett

    Technical Editors: Terry Collings, Corey Hynes

    Editorial Manager: Leah Cameron

    Media Development Manager: Laura VanWinkle

    Media Development Supervisor: Richard Graves

    Editorial Assistant: Amanda Foxworth

    Cartoons: Rich Tennant (www.the5thwave.com)

    Publishers AcknowledgmentsWere proud of this book; please send us your comments through our online regis-tration form located at www.dummies.com/register/.

    Some of the people who helped bring this book to market include the following:

    Publishing and Editorial for Technology DummiesRichard Swadley, Vice President and Executive Group Publisher

    Andy Cummings, Vice President and Publisher

    Mary Bednarek, Executive Editorial Director

    Mary C. Corder, Editorial Director

    Publishing for Consumer DummiesDiane Graves Steele, Vice President and Publisher

    Joyce Pepple, Acquisitions Director

    Composition ServicesGerry Fahey, Vice President of Production Services

    01a_571737ffirs.qxd 7/2/04 7:55 PM Page iv

  • Contents at a GlanceIntroduction 1

    Part I: Making the Desktop Work for You 5Technique 1: Finding the Power in

    KDE Protocols 7

    Technique 2: Getting GNOME Virtual FileSystems to Do the Work for You 13

    Technique 3: Streamlining Your Work withFile Associations 18

    Technique 4: Prompting Yourself with aCustom Prompt 23

    Technique 5: Getting There Quick withDynamic Shortcuts 30

    Technique 6: Using cd Shortcuts for Rapid Transit 34

    Technique 7: Typing Less and Doing Morewith Handy Automagic Variables 38

    Technique 8: Logging In, Logging Out 45

    Technique 9: Making History (Work for You) 50

    Technique 10: Keeping Your Life Simple withAliases and Functions 55

    Part II: Getting the Most fromYour File System 63Technique 11: Sharing Files and Printers in a

    Windows World 65

    Technique 12: Finding What You Need 73

    Technique 13: Moving Made Easy with Archives 82

    Technique 14: Downloading and Uploading Files in a Snap 88

    Technique 15: Building a Playpen withUser Mode Linux 94

    Part III: Good Housekeeping with Linux 101Technique 16: Red-lining RPM Queries 103

    Technique 17: Installing Made Easy with RPM 108

    Technique 18: Getting Comfortable with RPM 115

    Technique 19: Keeping Up-to-Date with aptand Synaptic 119

    Technique 20: Setting Up Automatic Services 126

    Technique 21: Making Your Inner SystemAdministrator Happy (And Productive) 130

    Technique 22: Spring Cleaning Essentials 137

    Part IV: Tweaking the Kernel onYour Linux System 149Technique 23: Taking Good Care of

    Your Kernel 151

    Technique 24: Creating a Custom Kernel 157

    Technique 25: Coping with the SELinuxSecurity System 164

    Technique 26: Finding Out about Your System with /proc 170

    Part V: Securing Your Workspace 177Technique 27: Closing Those Prying Eyes 179

    Technique 28: Using Encryption for Extra Security 184

    Technique 29: Securing a Large Networkwith Custom Authentication 194

    Technique 30: Customizing Authentication with PAM 203

    Technique 31: Gaining Privileges 209

    Technique 32: sudo Pseudonyms 213

    Technique 33: Securing Your Connections with SSH 218

    01b_571737ftoc.qxd 7/2/04 7:55 PM Page v

  • Part IX: Backing Up Means Never Having to Say Youre Sorry 369Technique 49: Getting Ready to Back Up

    Your Data 371

    Technique 50: Backing Up Your Data 377

    Technique 51: Quick Backup to Remote Storage 386

    Technique 52: Archiving Changes with CVS 391

    Part X: Programming Tricks 401Technique 53: Using Open-Source APIs

    to Save Time 403

    Technique 54: Timesaving PHP Tricks 414

    Technique 55: Using the DDD GraphicalDebugger with Perl 422

    Part XI: The Scary (Or Fun!) Stuff 429Technique 56: Burning CD-Rs without

    Getting Burned 431

    Technique 57: Search and Destroy setuid and setgid Programs 437

    Technique 58: Quarantining SuspiciousPrograms with UML 443

    Technique 59: Troubles