List of JumpStarts xxxvii Preface xxxix Chapter 1: Welcome to Linux 1 Ubuntu Linux 2 The History of UNIX and GNU-Linux 3 What Is So Good About Linux? 6 Overview of Linux 12 Additional Features of Linux 17 Conventions Used in This Book 19 Chapter Summary 21 Exercises 22 Part I: Installing Ubuntu Linux 23 Chapter 2: Installation Overview 25 The Live/Install Desktop CD and the Live/Install DVD 26 More Information 26 Planning the Installation 27 The Installation Process 42 Downloading and Burning a CD/DVD 43 Gathering Information About the System 47 Chapter Summary 49 Exercises 49 Advanced Exercises 49 Chapter 3: Step-by-Step Installation 51 Booting from a Live/Install Desktop CD or a Live/Install DVD 52 Graphical Partition Editors 63 Upgrading to a New Release 74 Installing KDE 75 Setting Up a Dual-Boot System 76 Advanced Installation 77 Chapter Summary 93 Exercises 94 Advanced Exercises 94 Part II: Getting Started with Ubuntu Linux 95 Chapter 4: Introduction to Ubuntu Linux 97 Curbing Your Power: root Privileges/sudo 98 A Tour of the Ubuntu Desktop 99 Getting Help 116 Updating, Installing, and Removing Software Packages 131 Where to Find Documentation 136 More About Logging In 144 Working from the Command Line 150 Controlling Windows: Advanced Operations 153 Chapter Summary 156 Exercises 157 Advanced Exercises 158 Chapter 5: The Linux Utilities 159 Special Characters 160 Basic Utilities 161 Working with Files 163 | (Pipe): Communicates Between Processes 170 Four More Utilities 171 Compressing and Archiving Files 174 Locating Commands 178 Obtaining User and System Information 180 Communicating with Other Users 184 Email 185 Tutorial: Using vim to Create and Edit a File 186 Chapter Summary 193 Exercises 196 Advanced Exercises 197 Chapter 6: The Linux Filesystem 199 The Hierarchical Filesystem 200 Directory Files and Ordinary Files 200 Pathnames 205 Working with Directories 207 Access Permissions 215 ACLs: Access Control Lists 221 Links 226 Chapter Summary 232 Exercises 234 Advanced Exercises 236 Chapter 7: The Shell 237 The Command Line 238 Standard Input and Standard Output 243 Running a Command in the Background 254 Filename Generation/Pathname Expansion 256 Builtins 261 Chapter Summary 261 Exercises 262 Advanced Exercises 264 Part III: Digging into Ubuntu Linux 265 Chapter 8: Linux GUIs: X and GNOME 267 X Window System 268 The Nautilus File Browser Window 276 The Nautilus Spatial View 282 GNOME Utilities 284 Chapter Summary 288 Exercises 289 Advanced Exercises 289 Chapter 9: The Bourne Again Shell 291 Background 292 Shell Basics 293 Parameters and Variables 312 Special Characters 326 Processes 328 History 330 Aliases 346 Functions 349 Controlling bash: Features and Options 352 Processing the Command Line 356 Chapter Summary 365 Exercises 367 Advanced Exercises 369 Chapter 10: Networking and the Internet 371 Types of Networks and How They Work 373 Communicate over a Network 388 Network Utilities 390 Distributed Computing 397 Usenet 407 WWW: World Wide Web 409 Chapter Summary 411 Exercises 412 Advanced Exercises 413 Part IV: System Administration 415 Chapter 11: System Administration: Core Concepts 417 Running Commands with root Privileges 419 The Upstart Event-Based init Daemon 432 System Operation 443 Avoiding a Trojan Horse 453 Getting Help 454 Textual System Administration Utilities 455 Setting Up a Server 460 nsswitch.conf: Which Service to Look at First 475 PAM 478 Chapter Summary 483 Exercises 484 Advanced Exercises 484 Chapter 12: Files, Directories, and Filesystems 487 Important Files and Directories 488 File Types 500 Filesystems 505 Chapter Summary 514 Exercises 515 Advanced Exercises 515 Chapter 13: Downloading and Installing Software 517 JumpStart: Installing and Removing Packages Using aptitude 519 Finding the Package That Holds a File You Need 521 APT: Keeps the System Up-to-Date 522 dpkg: The Debian Package Management System 532 BitTorrent 539 Installing Non-dpkg Software 541 wget: Downloads Files Noninteractively 543 Chapter Summary 544 Exercises 545 Advanced Exercises 545 Chapter 14: Printing with CUPS 547 Introduction 548 JumpStart I: Configuring a Local Printer 549 system-config-printer: Configuring a Printer 550 JumpStart II: Setting Up a Local or Remote Printer Using the CUPS Web Interface 555 Traditional UNIX Printing 558 Configuring Printers 560 Printing from Windows 566 Printing to Windows 568 Chapter Summary 568 Exercises 569 Advanced Exercises 569 Chapter 15: Building a Linux Kernel 571 Prerequisites 572 Downloading the Kernel Source Code 573 Read the Documentation 575 Configuring and Compiling the Linux Kernel 575 Installing the Kernel, Modules, and Associated Files 582 Rebooting 583 GRUB: The Linux Boot Loader 583 dmesg: Displays Kernel Messages 589 Chapter Summary 590 Exercises 590 Advanced Exercises 591 Chapter 16: Administration Tasks 593 Configuring User and Group Accounts 594 Backing Up Files 599 Scheduling Tasks 605 System Reports 608 parted: Reports on and Partitions a Hard Disk 611 Keeping Users Informed 614 Creating Problems 615 Solving Problems 616 MySQL 628 Chapter Summary 635 Exercises 636 Advanced Exercises 636 Chapter 17: Configuring and Monitoring a LAN 637 Setting Up the Hardware 638 Configuring the Systems 641 NetworkManager: Configures Network Connections 642 Setting Up Servers 646 Introduction to Cacti 647 More Information 658 Chapter Summary 659 Exercises 660 Advanced Exercises 660 Part V: Using Clients and Setting Up Servers 661 Chapter 18: OpenSSH: Secure Network Communication 663 Introduction to OpenSSH 664 Running the ssh, scp, and sftp OpenSSH Clients 667 Setting Up an OpenSSH Server (sshd) 676 Troubleshooting 680 Tunneling/Port Forwarding 681 Chapter Summary 684 Exercises 684 Advanced Exercises 685 Chapter 19: FTP: Transferring Files Across a Network 687 Introduction to FTP 688 Running the ftp and sftp FTP Clients 690 Setting Up an FTP Server (vsftpd) 699 Chapter Summary 711 Exercises 712 Advanced Exercises 712 Chapter 20: exim4: Setting Up Mail Servers, Clients, and More 713 Introduction to exim4 714 Setting Up a Mail Server (exim4) 715 Working with exim4 Messages 720 Configuring an exim4 Mail Server 724 SpamAssassin 727 Additional Email Tools 731 Authenticated Relaying 736 Chapter Summary 738 Exercises 738 Advanced Exercises 739 Chapter 21: NIS and LDAP 741 Introduction to NIS 742 Running an NIS Client 744 Setting Up an NIS Server 750 LDAP 758 Setting Up an LDAP Server 760 Other Tools for Working with LDAP 767 Chapter Summary 770 Exercises 771 Advanced Exercises 771 Chapter 22: NFS: Sharing Filesystems 773 Introduction to NFS 774 Running an NFS Client 776 Setting Up an NFS Server 782 automount: Mounts Directory Hierarchies on Demand 792 Chapter Summary 795 Exercises 795 Advanced Exercises 795 Chapter 23: Samba: Linux and Windows File and Printer Sharing 797 Introduction to Samba 798 Setting Up a Samba Server 800 Working with Linux Shares from Windows 814 Working with Windows Shares from Linux 815 Troubleshooting 817 Chapter Summary 819 Exercises 820 Advanced Exercises 820 Chapter 24: DNS/BIND: Tracking Domain Names and Addresses 821 Introduction to DNS 822 Setting Up a DNS Server 834 Setting Up Different Types of DNS Servers 850 Chapter Summary 860 Exercises 860 Advanced Exercises 861 Chapter 25: firestarter, gufw, and iptables: Setting Up a Firewall 863 Introduction to firestarter 864 firestarter: Setting Up and Maintaining a Firewall 866 ufw: The Uncomplicated Firewall 874 gufw: The Graphical Interface to ufw 876 Introduction to iptables 880 Building a Set of Rules Using iptables 885 Copying Rules to and from the Kernel 891 Sharing an Internet Connection Using NAT 892 Chapter Summary 896 Exercises 897 Advanced Exercises 897 Chapter 26: Apache: Setting Up a Web Server 899 Introduction 900 Running a Web Server (Apache) 902 Configuration Directives 909 Configuration Files 932 Advanced Configuration 935 Troubleshooting 940 Modules 941 webalizer: Analyzes Web Traffic 948 MRTG: Monitors Traffic Loads 948 Error Codes 948 Chapter Summary 949 Exercises 950 Advanced Exercises 950 Part VI: Programming Tools 951 Chapter 27: Programming the Bourne Again Shell 953 Control Structures 954 File Descriptors 987 Parameters and Variables 990 Builtin Commands 1002 Expressions 1016 Shell Programs 1024 Chapter Summary 1034 Exercises 1036 Advanced Exercises 1038 Chapter 28: The Perl Scripting Language 1041 Introduction to Perl 1042 Variables 1049 Control Structures 1057 Working with Files 1066 Sort 1069 Subroutines 1071 Regular Expressions 1073 CPAN Modules 1079 Examples 1081 Chapter Summary 1085 Exercises 1085 Advanced Exercises 1086 Part VII: Appendixes 1087 Appendix A: Regular Expressions 1089 Characters 1090 Delimiters 1090 Simple Strings 1090 Special Characters 1090 Rules 1093 Bracketing Expressions 1094 The Replacement String 1094 Extended Regular Expressions 1095 Appendix Summary 1097 Appendix B: Help 1099 Solving a Problem 1100 Finding Linux-Related Information 1101 Specifying a Terminal 1106 Appendix C: Security 1109 Encryption 1110 File Security 1115 Email Security 1115 Network Security 1116 Host Security 1119 Security Resources 1124 Appendix Summary 1127 Appendix D: The Free Software Definition 1129 Glossary 1133 JumpStart Index 1183 File Tree Index 1185 Utility Index 1189 Main Index 1195
Mark G. Sobell is President of Sobell Associates Inc., a consulting firm that specializes in UNIX/Linux training, support, and custom software development. He has more than twenty-five years of experience working with UNIX and Linux systems and is author of many best-selling books, including A Practical Guide to Red Hat (R) Linux (R), Fifth Edition; A Practical Guide to Linux (R) Commands, Editors, and Shell Programming, Second Edition; and A Practical Guide to Linux (R) for Mac OS (R) X Users (with Peter Seebach), all from Prentice Hall; and A Practical Guide to the UNIX System from Addison-Wesley.
Praise for Previous Editions of A Practical Guide to Ubuntu Linux (R) "I am so impressed by how Mark Sobell can approach a complex topic in such an understandable manner. His command examples are especially useful in providing a novice (or even an advanced) administrator with a cookbook on how to accomplish real-world tasks on Linux. He is truly an inspired technical writer!" -George Vish II, Senior Education Consultant, Hewlett-Packard Company "Overall, I think it's a great, comprehensive Ubuntu book that'll be a valuable resource for people of all technical levels." -John Dong, Ubuntu Forum Council Member, Backports Team Leader "The JumpStart sections really offer a quick way to get things up and running, allowing you to dig into the details of the book later." -Scott Mann, Aztek Networks "This entire book is a real boon to any neophyte who does not have a solid handle on getting their own answers. That group is the one that I think will benefit the most from A Practical Guide to Ubuntu Linux (R). Random access is easy, but reading cover to cover would also give one a nice foundational understanding of getting the most out of their machine and even enough guidance to get their feet wet in the sysadmin world. Anyone thrown into owning an Ubuntu server may find this to be a handy lifeline." -JR Peck, Editor, GeekBook.org "Very well thought out and simplified. [I] would buy another book from this author (Mark Sobell)." -Greg Dye, Electronic Tech "Ubuntu is gaining popularity at the rate alcohol did during Prohibition, and it's great to see a well-known author write a book on the latest and greatest version. Not only does it contain Ubuntu-specific information, but it also touches on general computer-related topics, which will help the average computer user to better understand what's going on in the background. Great work, Mark!" -Daniel R. Arfsten, Pro/ENGINEER Drafter/Designer "I would so love to be able to use this book to teach a class about not just Ubuntu or Linux but about computers in general. It is thorough and well written with good illustrations that explain important concepts for computer usage." -Nathan Eckenrode, New York Local Community Team "I read a lot of Linux technical information every day, but I'm rarely impressed by tech books. I usually prefer online information sources instead. Mark Sobell's books are a notable exception. They're clearly written, technically accurate, comprehensive, and actually enjoyable to read." -Matthew Miller, Senior Systems Analyst/Administrator, BU Linux Project, Boston University Office of Information Technology "Overall, A Practical Guide to Ubuntu Linux (R) by Mark G. Sobell provides all of the information a beginner to intermediate user of Linux would need to be productive. The inclusion of the Live DVD of the Gutsy Gibbon release of Ubuntu makes it easy for the user to test-drive Linux without affecting his installed OS. I have no doubts that you will consider this book money well spent." -Ray Lodato, Slashdot contributor, www.slashdot.org "This is well-written, clear, comprehensive information for the Linux user of any type, whether trying Ubuntu on for the first time and wanting to know a little about it, or using the book as a very good reference when doing something more complicated like setting up a server. This book's value goes well beyond its purchase price and it'll make a great addition to the Linux section of your bookshelf." -Linc Fessenden, Host of The LinuxLink TechShow, tllts.org "The author has done a very good job at clarifying such a detail-oriented operating system. I have extensive UNIX and Windows experience and this text does an excellent job at bridging the gaps between Linux, Windows, and UNIX. I highly recommend this book to both `newbs' and experienced users. Great job!" -Mark Polczynski, Information Technology Consultant "When I first started working with Linux just a short 10 years or so ago, it was a little more difficult than now to get going. . . . Now, someone new to the community has a vast array of resources available on the web, or if they are inclined to begin with Ubuntu, they can literally find almost every single thing they will need in the single volume of Mark Sobell's A Practical Guide to Ubuntu Linux (R). "I'm sure this sounds a bit like hyperbole. Everything a person would need to know? Obviously not everything, but this book, weighing in at just under 1200 pages, covers so much so thoroughly that there won't be much left out. From install to admin, networking, security, shell scripting, package management, and a host of other topics, it is all there. GUI and command line tools are covered. There is not really any wasted space or fluff, just a huge amount of information. There are screen shots when appropriate but they do not take up an inordinate amount of space. This book is information-dense." -JR Peck, Editor, GeekBook.org "Mark G. Sobell's freshly revised reference work on Ubuntu Linux may be the most impressive computer book I've seen in the last 10 years. If you are currently stranded with a pile of abandoned computers on a desert isle, I'm telling you, this is the book." -From a review at DesktopLinux.com, http://www.desktoplinux.com/news/NS8801274918.html Praise for Other Books by Mark G. Sobell "I currently own one of your books, A Practical Guide to Linux (R). I believe this book is one of the most comprehensive and, as the title says, practical guides to Linux I have ever read. I consider myself a novice and I come back to this book over and over again." -Albert J. Nguyen "Thank you for writing a book to help me get away from Windows XP and to never touch Windows Vista. The book is great; I am learning a lot of new concepts and commands. Linux is definitely getting easier to use." -James Moritz "I have been wanting to make the jump to Linux but did not have the guts to do so-until I saw your familiarly titled A Practical Guide to Red Hat (R) Linux (R) at the bookstore. I picked up a copy and am eagerly looking forward to regaining my freedom." -Carmine Stoffo, Machine and Process Designer to pharmaceutical industry "I am currently reading A Practical Guide to Red Hat (R) Linux (R) and am finally understanding the true power of the command line. I am new to Linux and your book is a treasure." -Juan Gonzalez