Michael McCallister openSUSE Linux U N L E A S H E D 800 East 96th Street,Indianapolis,Indiana 46240 USA openSUSE Linux Unleashed Associate Publisher Copyright © 2008 by Sams Publishing Mark Taber All rights reserved. No part of this book shall be reproduced,stored in a retrieval Development Editors system,or transmitted by any means,electronic,mechanical,photocopying,recording, or otherwise,without written permission from the publisher. No patent liability is Damon Jordon assumed with respect to the use of the information contained herein. Although every Michael Thurston precaution has been taken in the preparation of this book,the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for Managing Editor damages resulting from the use of the information contained herein. Patrick Kanouse This material may be distributed only subject to the terms and conditions set forth in the Open Publication License,v1.0 or later (the latest version is presently available at Project Editor http://www.opencontent.org/openpub/). Mandie Frank ISBN-13: 978-0-672-32945-6 ISBN-10: 0-672-32945-X Copy Editor Library of Congress Cataloging-in-Publication Data: Jill Batistick McCallister,Michael. Indexer OpenSUSE Linux unleashed / Michael McCallister. Ken Johnson p. cm. Includes index. Proofreader ISBN 978-0-672-32945-6 (pbk. w/dvd) Susan Eldridge 1. Linux. 2. Operating systems (Computers) I. Title. Technical Editor QA76.76.O63M37486 2007 Tim Boronczyk 005.4'32--dc22 2007033555 Publishing Printed in the United States on America Coordinator First Printing October 2007 Vanessa Evans Trademarks Multimedia Developer All terms mentioned in this book that are known to be trademarks or service marks Dan Scherf have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the Designer validity of any trademark or service mark. Gary Adair Warning and Disclaimer Every effort has been made to make this book as complete and as accurate as possi- Composition ble,but no warranty or fitness is implied. The information provided is on an “as is” TnT Design,Inc basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or from the use of the DVD or programs accompanying it. Bulk Sales Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information,please contact U.S. Corporate and Government Sales 1-800-382-3419 [email protected] For sales outside of the U.S.,please contact International Sales [email protected] ||||||||||||||||||||||||||||||||||||||||||||||||| http://itbookshub.com/ Contents at a Glance Introduction...................................................................................1 Part I: Installation and Configuration 7 1 Welcome to openSUSE......................................................................9 2 Preparing to Install openSUSE..........................................................23 3 Installing openSUSE.......................................................................35 4 Further Configuration with YaST and SaX2.........................................49 Part II: Using openSUSE 69 5 Getting Started with openSUSE.........................................................71 6 Launching Your Desktop.................................................................97 7 Printing with openSUSE................................................................123 8 Shaking Hands with Your Shell.......................................................139 9 Being Productive: Office Suites and Other Tools.................................161 10 Sights, Sounds, and Other Fun Things..............................................187 11 Going Cross-Platform....................................................................227 Part III: Using the Internet 245 12 Connecting to the Internet............................................................247 13 Using the Internet: Browsing the Web and Writing Email....................265 14 Creating Basic Websites.................................................................289 15 Managing Email Servers.................................................................311 16 Collaborating with Others.............................................................333 17 Secure File Transfer.......................................................................357 Part IV: Basic System Administration 371 18 Managing Files, Volumes, and Drives...............................................373 19 Managing Users, Managing Security................................................403 20 Managing Data: Backup, Restoring, and Recovery..............................419 21 Keeping Your System Current: Package Management..........................441 ||||||||||||||||||||||||||||||||||||||||||||||||| http://itbookshub.com/ Part V: Advanced System Administration 457 22 Managing the Boot Process and Other Services..................................459 23 Securing Your Machines ................................................................477 24 Kernel and Module Management....................................................493 25 Setting Up Networks and Samba.....................................................507 26 Managing Web and FTP Servers......................................................529 27 Managing Domain Names..............................................................549 Part VI: Programming 567 28 Programming Tools.......................................................................569 29 Managing Databases.....................................................................589 30 Using Perl and Python..................................................................611 31 Creating Dynamic Websites............................................................627 32 Performance Tuning......................................................................641 33 Command-Line Master Class..........................................................651 Index.........................................................................................667 ||||||||||||||||||||||||||||||||||||||||||||||||| http://itbookshub.com/ Table of Contents Introduction 1 Why Use Linux?..............................................................................2 Who This Book Is For.......................................................................3 What This Book Contains.................................................................3 Conventions Used in This Book.........................................................5 Part I Installation and Configuration 7 1 Welcome to openSUSE 9 What Is openSUSE?..........................................................................9 openSUSE Linux.....................................................................10 The openSUSE.org Wiki...........................................................12 The openSUSE Install Program..................................................13 File Systems in openSUSE........................................................13 64-Bit openSUSE....................................................................14 Getting Help: Documentation and Other Sources................................14 Printed Documentation and the openSUSE Help Center...............14 Searching the Help Center.......................................................15 Man and Info Pages................................................................16 openSUSE Online Support.......................................................17 The Linux Documentation Project ............................................17 The openSUSE Mailing Lists.....................................................18 Filing a Bug in openSUSE’s Bug Tracker......................................19 Linux User Groups.................................................................20 References.....................................................................................21 2 Preparing to Install openSUSE 23 Planning Your openSUSE Installation................................................24 System Requirements......................................................................25 Linux on Laptops...................................................................27 openSUSE and Legacy Hardware...............................................27 Avoiding Potential Hardware Problems......................................28 Dual Booting, Partitioning, and Other Worries............................29 Dual Booting with Windows....................................................30 How to Partition Your Drive(s)..................................................31 References.....................................................................................32 |||||||||w|||w|||w|||.|i|t||-|e||b|||o||o|||k||s||.|i|n||f||o|||||| http://itbookshub.com/ vi openSUSE Linux Unleashed 3 Installing openSUSE 35 Methods of Installing openSUSE.......................................................35 Preparing to Install from a CD-ROM or DVD......................................35 Installing openSUSE with YaST.........................................................37 Setting Your Time Zone...........................................................38 Selecting a Desktop Environment..............................................38 Initial Installation Settings.......................................................38 Partitioning...........................................................................38 Installing Software Packages.....................................................39 Creating the Root User............................................................40 Setting a Hostname and Domain Name......................................41 Configuring Network and Internet Connections..........................41 Creating a User......................................................................44 Configuring Hardware for the X Window System........................45 Logging In and Shutting Down the First Time.....................................46 References.....................................................................................47 4 Further Configuration with YaST and SaX2 49 Troubleshooting Installation Problems...............................................49 Configuring Hardware with YaST......................................................50 Gathering Information About Your Hardware..............................50 Modifying Disk Controller Settings............................................50 Configuring Your Sound and Video Cards..................................51 Configuring a Joystick.............................................................54 Adjusting Your Keyboard Layout...............................................54 Configuring Your Mouse..........................................................55 Configuring Your Scanner........................................................56 Configuring Your TV or Radio Card...........................................56 Setting Date and Time....................................................................57 Using the Network Time Protocol (NTP) to Keep Accurate Time.....58 Power Management........................................................................61 YaST Power Management.........................................................62 Portable PC Issues..........................................................................64 Power Management for Laptops................................................64 Working with PCMCIA Cards...................................................64 Configuring Bluetooth Wireless Support.....................................64 Configuring Infrared Interface (IrDA) Mode................................65 Configuring CD, DVD, and Rewritable Drives.....................................66 Integrating CD and DVD Drives into Your System .......................66 References.....................................................................................67 |||||||||w|||w|||w|||.|i|t||-|e||b|||o||o|||k||s||.|i|n||f||o|||||| http://itbookshub.com/ Contents vii Part II Using openSUSE 69 5 Getting Started with openSUSE 71 Logging In to openSUSE..................................................................72 Logging In from the Shell........................................................72 Logging Out of the Shell..........................................................72 Working with the Linux File System..................................................72 Essential File System Commands from the /binand/sbinDirectories....74 Using the /bootand/devDirectories................................................74 Editing Configuration Files in the /etcDirectory................................75 Where All the Good Stuff Goes: Your /homeDirectory..........................76 Finding Desktop Programs in /opt....................................................76 Where Most of the Programs Go: The /usrDirectory...........................77 Variable Data: The /varDirectory.....................................................77 Changing User Information and the Finger Program............................77 Choosing and Using a Shell.............................................................78 Cool Stuff That All Shells Have in Common...............................78 Runningbash........................................................................79 Runningtcsh........................................................................81 Runningzsh..........................................................................82 Managing Files with Midnight Commander................................82 kshandash...........................................................................83 Choosing a Shell....................................................................84 Editing Text..................................................................................85 Working with vimand Its Clones..............................................86 Working with emacsand Its Clones...........................................87 Some of the Others.................................................................88 Why Can’t I Edit This File? How Permissions Work..............................89 Changing Permissions.............................................................90 Directory Permissions.............................................................92 Working as Root............................................................................92 Creating and Deleting Users.....................................................93 Shutting Down and Rebooting the System..................................94 References.....................................................................................95 File System............................................................................95 Shells...................................................................................95 Editors..................................................................................96 Working as Root.....................................................................96 |||||||||w|||w|||w|||.|i|t||-|e||b|||o||o|||k||s||.|i|n||f||o|||||| http://itbookshub.com/ viii openSUSE Linux Unleashed 6 Launching Your Desktop 97 Understanding the X Window System...............................................98 Configuring X in openSUSE.....................................................98 3D Video with Xgl........................................................................100 Enabling Xgl........................................................................101 Configuring the Compiz Window Manager...............................102 Choosing a Desktop Environment: KDE and GNOME.........................102 KDE: The K Desktop Environment...........................................104 GNOME: The GNU Network Object Model Environment ............106 Managing Files from Your Desktop..................................................107 Using Konqueror in KDE........................................................108 Using Krusader in KDE..........................................................110 Using Nautilus in GNOME.....................................................111 Configuring Your Desktop Environment...........................................112 KDE Control Center..............................................................112 Customizing GNOME............................................................114 What Is a Window Manager and Why Would I Want to Use It?...........116 Why Run a Window Manager?...............................................116 Starting Up with a Window Manager.......................................117 Running FVWM...................................................................117 Running WindowMaker.........................................................118 Running IceWM...................................................................119 References...................................................................................120 7 Printing with openSUSE 123 Printing: An Overview...................................................................123 Common Unix Printing System (CUPS)............................................124 Configuring Printers with YaST.......................................................125 Configuring CUPS and Network Printers with KDEPrint......................130 Printing with CUPS.......................................................................132 Working with the Portable Document Format (PDF)...........................133 Console Print Control...................................................................135 Using Basic Print Commands..................................................135 Avoiding Printing Problems............................................................136 Multifunction (Print/Fax/Scanner) Devices................................136 USB and Older Inkjet Printers.................................................136 References...................................................................................137 8 Shaking Hands with Your Shell 139 What Is the Shell?........................................................................140 Using the Shell in openSUSE..........................................................141 Getting to the Shell...............................................................141 |||||||||w|||w|||w|||.|i|t||-|e||b|||o||o|||k||s||.|i|n||f||o|||||| http://itbookshub.com/ Contents ix Creating Scripts....................................................................143 Running Scripts....................................................................144 The Power of the Command Line....................................................146 Pattern Matching in the Shell.................................................147 Redirecting Input and Output.................................................149 Piping Data.........................................................................149 Background Processing..........................................................150 Basic Shell Programming...............................................................150 Displaying Messages..............................................................150 Using System Variables..........................................................151 Creating User Variables..........................................................152 The Backtick........................................................................153 Arithmetic...........................................................................154 Advanced Shell Programming.........................................................155 User Input...........................................................................155 Flow Control.......................................................................156 References...................................................................................159 9 Being Productive: Office Suites and Other Tools 161 Comparing Linux Office Suites.......................................................161 Running OpenOffice.org........................................................162 Running KOffice...................................................................168 Running GNOME Office........................................................171 Running Softmaker Office......................................................172 Other Commercial Suites.......................................................172 Connecting with PDAs and Smart Phones........................................174 Command-Line PDA Software for openSUSE.............................174 Managing Your Finances........................................................175 More Tools to Make You Productive.................................................178 Voice-over-IP (VoIP) with Skype and Ekiga................................178 Desktop Publishing with Scribus.............................................180 Diagramming and Flowcharting with Dia and Kivio...................181 Mindmapping with VYM.......................................................182 Fax and Scanner Applications.................................................183 References...................................................................................185 10 Sights,Sounds,and Other Fun Things 187 Playing Music and Listening to the Radio.........................................187 Sound Formats.....................................................................187 Audio Player Overview..........................................................189 Amarok...............................................................................190 Banshee..............................................................................194 |||||||||w|||w|||w|||.|i|t||-|e||b|||o||o|||k||s||.|i|n||f||o|||||| http://itbookshub.com/