A Practical Guide to Ubuntu Linux (Versions 8.10 and 8.04) by Mark G. SobellA Practical Guide to Ubuntu Linux (Versions 8.10 and 8.04) by Mark G. Sobell

A Practical Guide to Ubuntu Linux (Versions 8.10 and 8.04)

byMark G. Sobell

Paperback | December 30, 2008

Pricing and Purchase Info


Earn 275 plum® points

Prices and offers may vary in store

Out of stock online

Not available in stores


The Most Complete, Easy-to-Follow Guide to Ubuntu Linux


Mark Sobell’s A Practical Guide to Ubuntu Linux®, Second Edition, isn’t just the most thorough and up-to-date reference to installing, configuring, and working with Ubuntu. It also provides comprehensive server coverage you won’t find in any other Ubuntu book.


The fully updated JumpStart sections help you get complex servers running quickly. Whatever your questions may be, the completely revamped index gives you even faster access to the answers you’re searching for. And a brand new chapter on Perl programming teaches you the basics of this powerful system administration language.


Sobell walks you through every feature and technique you’ll need, from installing Ubuntu to working with GNOME, Samba, exim4, Apache, DNS, NIS, LDAP, ufw, firestarter, and iptables. His exceptionally clear explanations demystify everything from system security to Windows file/printer sharing. You’ll find full chapters on running Ubuntu from the command line and GUI, administering systems and security, setting up networks and Internet servers, and much more. 


Along the way, you’ll learn both the “hows” and the “whys” of Ubuntu. Sobell knows every Linux nook and cranny: He’s taught hundreds of thousands of readers–and never forgets what it’s like to be new to
Linux. Whether you’re a user, administrator, or programmer, this book gives you all you need–and more.


The world’s most practical Ubuntu Linux book is now even more useful!


This book delivers

  • Hundreds of easy-to-follow, easy-to-use examples
  • Updated JumpStarts for setting up Samba, Apache, Mail, FTP, NIS, OpenSSH, DNS, and other complex servers
  • Deeper coverage of the command line, GNOME GUI, and desktop customization
  • Coverage of crucial Ubuntu topics such as sudo and the Upstart init daemon
  • More detailed, usable coverage of Internet server configuration, including Apache, exim4, and DNS/BIND
  • More state-of-the-art security techniques, including firewall setup using ufw, firestarter, and iptables,
    plus a full chapter on OpenSSH
  • Deeper coverage of essential system and network administration tasks–from managing users to
    CUPS printing, configuring LANs to building a kernel
  • Complete instructions on keeping Ubuntu systems up-to-date using aptitude, Synaptic, and the Software Sources window
  • And much more...including a 500+ term glossary and five detailed appendixes 
  • Includes DVD!  Get the full version of the Ubuntu 8.10 (Intrepid Ibex) release!

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 the author of many best-selling books, including A Practical Guide to Red Hat® Linux®, Fo...
Title:A Practical Guide to Ubuntu Linux (Versions 8.10 and 8.04)Format:PaperbackDimensions:1272 pages, 9.12 × 7.3 × 2.08 inPublished:December 30, 2008Publisher:Pearson EducationLanguage:English

The following ISBNs are associated with this title:

ISBN - 10:0137003889

ISBN - 13:9780137003884


Table of Contents

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? 7

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/DVD 26

More Information 26

Planning the Installation 27

The Installation Process 41

Downloading and Burning a CD/DVD 42

Gathering Information About the System 46

Chapter Summary 47

Exercises 48

Advanced Exercises 48


Chapter 3: Step-by-Step Installation 49

Basic Installation from the Live/Install Desktop CD/DVD 50

Graphical Partitioners 58

Upgrading to a New Release 64

Installing KDE 65

Setting Up a Dual-Boot System 66

Advanced Installation 67

Chapter Summary 81

Exercises 81

Advanced Exercises 81


PART II: Getting Started with Ubuntu Linux 83


Chapter 4: Introduction to Ubuntu Linux 85

Curbing Your Power: root Privileges/sudo 86

A Tour of the Ubuntu Linux Desktop 87

Getting the Most out of the Desktop 104

Updating, Installing, and Removing Software Packages 116

Where to Find Documentation 121

More About Logging In 130

Working from the Command Line 135

Controlling Windows: Advanced Operations 138

Chapter Summary 140

Exercises 142

Advanced Exercises 142


Chapter 5: The Linux Utilities 145

Special Characters 146

Basic Utilities 147

Working with Files 149

(Pipe): Communicates Between Processes 156

Four More Utilities 157

Compressing and Archiving Files 160

Locating Commands 164

Obtaining User and System Information 166

Communicating with Other Users 170

Email 171

Tutorial: Using vim to Create and Edit a File 172

Chapter Summary 179

Exercises 182

Advanced Exercises 183


Chapter 6: The Linux Filesystem 185

The Hierarchical Filesystem 186

Directory Files and Ordinary Files 186

Pathnames 191

Working with Directories 193

Access Permissions 201

ACLs: Access Control Lists 207

Links 212

Chapter Summary 218

Exercises 220

Advanced Exercises 222


Chapter 7: The Shell 223

The Command Line 224

Standard Input and Standard Output 229

Running a Command in the Background 240

Filename Generation/Pathname Expansion 242

Builtins 247

Chapter Summary 247

Exercises 248

Advanced Exercises 250


PART III: Digging into Ubuntu Linux 251


Chapter 8: Linux GUIs: X and GNOME 253

X Window System 254

The Nautilus File Browser Window 262

GNOME Utilities 269

Chapter Summary 272

Exercises 273

Advanced Exercises 274


Chapter 9: The Bourne Again Shell 275

Background 276

Shell Basics 277

Parameters and Variables 296

Special Characters 310

Processes 312

History 314

Aliases 330

Functions 333

Controlling bash: Features and Options 336

Processing the Command Line 340

Chapter Summary 349

Exercises 351

Advanced Exercises 353


Chapter 10: Networking and the Internet 355

Types of Networks and How They Work 357

Communicate Over a Network 372

Network Utilities 374

Distributed Computing 381

Usenet 391

WWW: World Wide Web 393

Chapter Summary 395

Exercises 396

Advanced Exercises 397


PART IV: System Administration 399


Chapter 11: System Administration: Core Concepts 401

Running Commands with root Privileges 403

The Upstart Event-Based init Daemon 416

System Operation 426

Avoiding a Trojan Horse 436

Getting Help 438

Textual System Administration Utilities 438

Setting Up a Server 443

nsswitch.conf: Which Service to Look at First 458

PAM 461

Chapter Summary 466

Exercises 467

Advanced Exercises 467


Chapter 12: Files, Directories, and Filesystems 469

Important Files and Directories 470

File Types 482

Filesystems 487

Chapter Summary 497

Exercises 497

Advanced Exercises 498


Chapter 13: Downloading and Installing Software 499

JumpStart: Installing and Removing Packages Using aptitude 501

Finding the Package That Holds a File You Need 503

APT: Keeps the System Up-to-Date 504

dpkg: The Debian Package Management System 514

BitTorrent 521

Installing Non-dpkg Software 523

wget: Downloads Files Noninteractively 525

Chapter Summary 526

Exercises 527

Advanced Exercises 527


Chapter 14: Printing with CUPS 529

Introduction 530

JumpStart I: Configuring a Local Printer 531

system-config-printer: Configuring a Printer 532

JumpStart II: Setting Up a Local or Remote Printer Using the CUPS Web Interface 538

Traditional UNIX Printing 542

Configuring Printers 543

Printing from Windows 550

Printing to Windows 552

Chapter Summary 552

Exercises 552

Advanced Exercises 553


Chapter 15: Building a Linux Kernel 555

Prerequisites 556

Downloading the Kernel Source Code 557

Read the Documentation 559

Configuring and Compiling the Linux Kernel 559

Installing the Kernel, Modules, and Associated Files 566

Rebooting 567

grub: The Linux Boot Loader 567

dmesg: Displays Kernel Messages 575

Chapter Summary 576

Exercises 576

Advanced Exercises 576


Chapter 16: Administration Tasks 577

Configuring User and Group Accounts 578

Backing Up Files 582

Scheduling Tasks 588

System Reports 591

parted: Reports on and Partitions a Hard Disk 593

Keeping Users Informed 597

Creating Problems 598

Solving Problems 599

Chapter Summary 610

Exercises 610

Advanced Exercises 611


Chapter 17: Configuring a LAN 613

Setting Up the Hardware 614

Configuring the Systems 617

Setting Up Servers 622

More Information 623

Chapter Summary 623

Exercises 624

Advanced Exercises 624


PART V: Using Clients and Setting Up Servers 625


Chapter 18: OpenSSH: Secure Network Communication 627

Introduction to OpenSSH 628

Running the ssh, scp, and sftp OpenSSH Clients 631

Setting Up an OpenSSH Server (sshd) 640

Troubleshooting 644

Tunneling/Port Forwarding 645

Chapter Summary 648

Exercises 648

Advanced Exercises 649


Chapter 19: FTP: Transferring Files Across a Network 651

Introduction to FTP 652

Running the ftp and sftp FTP Clients 654

Setting Up an FTP Server (vsftpd) 663

Chapter Summary 675

Exercises 676

Advanced Exercises 676


Chapter 20: exim4: Setting Up Mail Servers, Clients, and More 677

Introduction to exim4 678

Setting up a Mail Server (exim4) 679

Working with exim4 Messages 684

Configuring an exim4 Mail Server 688

SpamAssassin 691

Additional Email Tools 695

Authenticated Relaying 700

Chapter Summary 702

Exercises 702

Advanced Exercises 703


Chapter 21: NIS and LDAP 705

Introduction to NIS 706

Running an NIS Client 708

Setting Up an NIS Server 714

LDAP 722

Setting Up an LDAP Server 724

Other Tools for Working with LDAP 731

Chapter Summary 734

Exercises 735

Advanced Exercises 735


Chapter 22: NFS: Sharing Filesystems 737

Introduction to NFS 738

Running an NFS Client 740

Setting Up an NFS Server 746

automount: Mounts Directory Hierarchies on Demand 756

Chapter Summary 759

Exercises 759

Advanced Exercises 760


Chapter 23: Samba: Linux and Windows File and Printer Sharing 761

Introduction to Samba 762

Setting up a Samba Server 764

Working with Linux Shares from Windows 776

Working with Windows Shares from Linux 777

Troubleshooting 779

Chapter Summary 782

Exercises 782

Advanced Exercises 782


Chapter 24: DNS/BIND: Tracking Domain Names and Addresses 783

Introduction to DNS 784

Setting Up a DNS Server 796

Setting Up Different Types of DNS Servers 811

Chapter Summary 821

Exercises 821

Advanced Exercises 822


Chapter 25: firestarter, ufw, and iptables: Setting Up a Firewall 823

Introduction to firestarter 824

firestarter: Setting Up and Maintaining a Firewall 826

ufw: The Uncomplicated Firewall 834

Introduction to iptables 836

Building a Set of Rules Using iptables 841

Copying Rules to and from the Kernel 847

Sharing an Internet Connection Using NAT 848

Chapter Summary 852

Exercises 853

Advanced Exercises 853


Chapter 26: Apache: Setting Up a Web Server 855

Introduction 856

Running a Web Server (Apache) 858

Configuration Directives 865

Configuration Files 888

Advanced Configuration 891

Troubleshooting 896

Modules 897

webalizer: Analyzes Web Traffic 904

MRTG: Monitors Traffic Loads 904

Error Codes 904

Chapter Summary 905

Exercises 906

Advanced Exercises 906


PART VI: Programming Tools 907


Chapter 27: Programming the Bourne Again Shell 909

Control Structures 910

File Descriptors 943

Parameters and Variables 946

Builtin Commands 958

Expressions 972

Shell Programs 980

Chapter Summary 990

Exercises 992

Advanced Exercises 994


Chapter 28: Perl 997

Introduction to Perl 998

Variables 1004

Control Structures 1011

Working with Files 1020

Sort 1023

Subroutines 1025

Regular Expressions 1027

CPAN Modules 1033

Examples 1035

Chapter Summary 1038

Exercises 1039

Advanced Exercises 1039


PART VII: Appendixes 1041


Appendix A: Regular Expressions 1043

Characters 1044

Delimiters 1044

Simple Strings 1044

Special Characters 1044

Rules 1047

Bracketing Expressions 1048

The Replacement String 1048

Extended Regular Expressions 1049

Appendix Summary 1051


Appendix B: Help 1053

Solving a Problem 1054

Finding Linux-Related Information 1055

Specifying a Terminal 1060


Appendix C: Security 1063

Encryption 1064

File Security 1069

Email Security 1069

Network Security 1070

Host Security 1073

Security Resources 1078

Appendix Summary 1081


Appendix D: The Free Software Definition 1083


Appendix E: The Linux 2.6 Kernel 1087

Native Posix Thread Library (NPTL) 1088

IPSecurity (IPSec) 1088

Asynchronous I/O (AIO) 1088

O(1) Scheduler 1089

OProfile 1089

kksymoops 1089

Reverse Map Virtual Memory (rmap VM) 1089

HugeTLBFS: Translation Look-Aside Buffer Filesystem 1090

remap_file_pages 1090

2.6 Network Stack Features (IGMPv3, IPv6, and Others) 1090

Internet Protocol Virtual Server (IPVS) 1091

Access Control Lists (ACLs) 1091

4GB-4GB Memory Split: Physical Address Extension (PAE) 1091

Scheduler Support for HyperThreaded CPUs 1091

Block I/O (BIO) Block Layer 1091

Support for Filesystems Larger Than 2 Terabytes 1092

New I/O Elevators 1092

Interactive Scheduler Response Tuning 1092


Glossary 1093

JumpStart Index 1143

File Tree Index 1145

Utility Index 1149

Main Index 1155

Editorial Reviews

Praise for the First Edition of A Practical Guide to Ubuntu Linux®   “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   “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 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   “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   “Overall, A Practical Guide to Ubuntu Linux® 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®.    “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’tbe 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   Praise for Other Books by Mark G. Sobell   “I currently own one of your books, A Practical Guide to Linux®. 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® Linux® 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® Linux® and am finally understanding the true power of the command line. I am new to Linux and your book is a treasure.” —Juan Gonzalez