Mastering™ Unix
Kate Wrightson Joe Merlino
SYBEX®
• to tell the differences among many Unix variants
• to tell the difference between Free Software and commercial software
• the history of Unix, the Free Software Foundation, andother community projects
• the basics of Unix, including simple commands and utilities
• to create complex commands using Unix shell syntax
• to use and configure the Unix graphical user environment
• to automate routine tasks using the Bourne Again SHell(BASH) scripting language
• to use Unix's built-in utilities to schedule jobs for automatic execution
• to create a functional network using Unix's native networking tools
• to integrate Windows and Macintosh computers into yourUnix network
• to understand the basics of network security
• to provide service to users and allow them to use yournetwork
• to identify, obtain, install, and manage Unix software
• to configure and administer various internet serversincluding WWW, Usenet News, and email
• to use dozens of useful Unix terms and commands
BECOME A MASTER BY LEARNING
2817cifc.qxd 11/21/00 1:48 PM Page 1
Mastering Unix
2817cfm.qxd 11/20/00 10:03 AM Page i
This page intentionally left blank
MasteringTM Unix
Kate Wrightson andJoe Merlino
San Francisco • London • Paris • Düsseldorf • Soest
2817cfm.qxd 11/20/00 10:03 AM Page iii
Associate Publisher: Dick StaronContracts and Licensing Manager: Kristine O’CallaghanAcquisitions and Developmental Editor: Diane LoweryEditor: Ronn JostProduction Editor: Lorrie FinkTechnical Editor: Patrick RamseierBook Designer: Kris WarrenburgGraphic Illustrator: Richard Whitaker/Seventeenth Street StudiosElectronic Publishing Specialist: Seventeenth Street StudiosProofreader: Kevin Stoffel/Seventeenth Street StudiosIndexer: Nancy GuentherCD Technician: Keith McNeilCD Coordinator: Kara Eve SchwartzCover Designer: Design SiteCover Illustrator: Jack D. Myers
Copyright © 2001 SYBEX Inc., 1151 Marina Village Parkway,Alameda, CA 94501. World rights reserved. No part of this pub-lication may be stored in a retrieval system, transmitted, orreproduced in any way, including but not limited to photocopy,photograph, magnetic, or other record, without the prior agree-ment and written permission of the publisher.
Library of Congress Card Number: 00-106460
ISBN: 0-7821-2817-3
SYBEX and the SYBEX logo are either registered trademarks ortrademarks of SYBEX Inc. in the United States and/or othercountries.
Mastering is a trademark of SYBEX Inc.
Screen reproductions produced with FullShot 99. FullShot 99 ©1991–1999 Inbit Incorporated. All rights reserved. FullShot is atrademark of Inbit Incorporated.
Netscape Communications Corporation has not authorized,sponsored, endorsed, or approved this publication and is notresponsible for its content. Netscape and the Netscape Communi-cations Corporate Logos are trademarks and trade names ofNetscape Communications Corporation. All other product namesand/or logos are trademarks of their respective owners.
TRADEMARKS: SYBEX has attempted throughout this book todistinguish proprietary trademarks from descriptive terms by fol-lowing the capitalization style used by the manufacturer.
The author and publisher have made their best efforts to preparethis book, and the content is based upon final release softwarewhenever possible. Portions of the manuscript may be based uponpre-release versions supplied by software manufacturer(s). Theauthor and the publisher make no representation or warranties ofany kind with regard to the completeness or accuracy of the con-tents herein and accept no liability of any kind including but notlimited to performance, merchantability, fitness for any particularpurpose, or any losses or damages of any kind caused or allegedto be caused directly or indirectly from this book.
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
2817cfm.qxd 11/20/00 10:03 AM Page iv
Software License Agreement: Terms and Conditions
The media and/or any online materials accompanying this bookthat are available now or in the future contain programs and/ortext files (the “Software”) to be used in connection with the book.SYBEX hereby grants to you a license to use the Software, subjectto the terms that follow. Your purchase, acceptance, or use of theSoftware will constitute your acceptance of such terms.
The Software compilation is the property of SYBEX unless oth-erwise indicated and is protected by copyright to SYBEX orother copyright owner(s) as indicated in the media files (the“Owner(s)”). You are hereby granted a single-user license to usethe Software for your personal, noncommercial use only. Youmay not reproduce, sell, distribute, publish, circulate, or com-mercially exploit the Software, or any portion thereof, withoutthe written consent of SYBEX and the specific copyrightowner(s) of any component software included on this media.
In the event that the Software or components include specificlicense requirements or end-user agreements, statements of con-dition, disclaimers, limitations or warranties (“End-UserLicense”), those End-User Licenses supersede the terms and con-ditions herein as to that particular Software component. Yourpurchase, acceptance, or use of the Software will constitute youracceptance of such End-User Licenses.
By purchase, use or acceptance of the Software you further agreeto comply with all export laws and regulations of the UnitedStates as such laws and regulations may exist from time to time.
Software Support
Components of the supplemental Software and any offers associ-ated with them may be supported by the specific Owner(s) of thatmaterial but they are not supported by SYBEX. Information regard-ing any available support may be obtained from the Owner(s)using the information provided in the appropriate read.me files orlisted elsewhere on the media.
Should the manufacturer(s) or other Owner(s) cease to offer sup-port or decline to honor any offer, SYBEX bears no responsibility.This notice concerning support for the Software is provided foryour information only. SYBEX is not the agent or principal of theOwner(s), and SYBEX is in no way responsible for providing anysupport for the Software, nor is it liable or responsible for any sup-port provided, or not provided, by the Owner(s).
Warranty
SYBEX warrants the enclosed media to be free of physical defectsfor a period of ninety (90) days after purchase. The Software isnot available from SYBEX in any other form or media than that
enclosed herein or posted to www.sybex.com. If you discover adefect in the media during this warranty period, you may obtaina replacement of identical format at no charge by sending thedefective media, postage prepaid, with proof of purchase to:
SYBEX Inc.Customer Service Department1151 Marina Village ParkwayAlameda, CA 94501(510) 523-8233Fax: (510) 523-2373e-mail: [email protected]: HTTP://WWW.SYBEX.COM
After the 90-day period, you can obtain replacement media ofidentical format by sending us the defective disk, proof of pur-chase, and a check or money order for $10, payable to SYBEX.
Disclaimer
SYBEX makes no warranty or representation, either expressed orimplied, with respect to the Software or its contents, quality, per-formance, merchantability, or fitness for a particular purpose. Inno event will SYBEX, its distributors, or dealers be liable to you orany other party for direct, indirect, special, incidental, consequen-tial, or other damages arising out of the use of or inability to usethe Software or its contents even if advised of the possibility ofsuch damage. In the event that the Software includes an onlineupdate feature, SYBEX further disclaims any obligation to providethis feature for any specific duration other than the initial posting.The exclusion of implied warranties is not permitted by somestates. Therefore, the above exclusion may not apply to you. Thiswarranty provides you with specific legal rights; there may beother rights that you may have that vary from state to state. Thepricing of the book with the Software by SYBEX reflects the allo-cation of risk and limitations on liability contained in this agree-ment of Terms and Conditions.
Shareware Distribution
This Software may contain various programs that are distributedas shareware. Copyright laws apply to both shareware and ordi-nary commercial software, and the copyright Owner(s) retains allrights. If you try a shareware program and continue using it, youare expected to register it. Individual programs differ on detailsof trial periods, registration, and payment. Please observe therequirements stated in appropriate files.
Copy Protection
The Software in whole or in part may or may not be copy-protected or encrypted. However, in all cases, reselling or redis-tributing these files without authorization is expressly forbid-den except as specifically provided for by the Owner(s) therein.
2817cfm.qxd 11/20/00 10:03 AM Page v
This page intentionally left blank
For TW, whose world was a different one
but who was proud of us anyway
2817cfm.qxd 11/20/00 10:03 AM Page vii
ACKNOWLEDGMENTS
A large group of people worked to bring this book to you. Although Joe andKate get their names on the cover, there are many other folks whose hard workand effort made this book possible. We appreciate their diligence and patiencewith us over a long and bumpy period of time. We’re especially grateful to Sybexand Seventeenth Street Studios for their understanding; during the last part ofthis book’s writing, Kate’s father died unexpectedly. Our team accommodatedour transcontinental travels and made finishing the project as easy as possibleunder the circumstances.
In addition to the people whose names follow, we’d like to thank our agent,David Fugate, and Waterside Productions. David and the Waterside team keep usgoing and keep us working, and we love being part of their team. Kate alsothanks the usual suspects, especially Mason Kramer, who won the lucky randomdrawing to be named here.
Sybex
Sybex people made the project possible and kept it going, from the first contact tothe final printing. We’d especially like to thank the following people:
• Roger Stewart initially brought us into the project.
• Diane Lowery shepherded the first quarter of the book.
• Colleen Strand managed administrative details of the full project.
Editing Team
We have had good luck in our careers in being able to work with fine editors whounderstand what we’re trying to say and who catch all the places where we’vesaid it poorly. This project was no different, and we’d like to thank the two edi-tors who reviewed each chapter as it came past:
• Ronn Jost fixed our prose and ensured that we made sense, with the greatestof good humor and friendly e-mail.
2817cfm.qxd 11/20/00 10:03 AM Page viii
• Patrick Ramseier checked the technical validity of our work and kept usfrom giving you bad information.
Seventeenth Street Studios
The folks at Seventeenth Street Studios did most of the dirty work involved ingetting the book organized and arranged into a far more attractive package thanthe original documents ever promised. In particular, we’d like to thank the fol-lowing people:
• Lorrie Fink, our production coordinator, kept track of the schedule andtried valiantly to keep us on target despite our wildly erratic lives over thepast year.
• Kevin Stoffel proofread everything that went into the book and caught allthe errors before they hit the page.
• Richard Whitaker and Bob Giles laid out the pages as they appear here,composing them into readable and appealing form; Richard also redrew ourextremely amateur line drawings into more professional images.
2817cfm.qxd 11/20/00 10:03 AM Page ix
CONTENTS AT A GLANCE
Introduction xxxvii
PART I Introducing Unix 1
Chapter 1 History and Background of Unix 3
Chapter 2 Which Unix? 13
Chapter 3 Some Basic Unix Concepts 29
PART II Getting Started 39
Chapter 4 Logging In and Looking Around 41
Chapter 5 Navigating the Filesystem 55
PART III Unix Desktop Environments 63
Chapter 6 The X Window System: An Overview 65
Chapter 7 Advanced X Techniques 77
Chapter 8 Window Managers 97
Chapter 9 KDE 121
Chapter 10 Gnome 149
PART IV Using the Shell 175
Chapter 11 Introduction to the Bourne (Again) Shell 177
Chapter 12 Manipulating Files and Directories 189
Chapter 13 Customizing the Shell Environment 201
Chapter 14 Input and Output Redirection 215
Chapter 15 Other Shells 227
2817cfm.qxd 11/20/00 10:03 AM Page x
PART V Using Text Editors 241
Chapter 16 The ed Editor 243
Chapter 17 The vi Editor 255
Chapter 18 GNU Emacs 269
Chapter 19 pico, joe, and jed 285
Chapter 20 Graphical Text Editors 297
PART VI Shell Programming 311
Chapter 21 An Introduction to Shell Programming 313
Chapter 22 Variables 321
Chapter 23 Flow Control, Part I: Conditional Flow Control 333
Chapter 24 Flow Control, Part II: Iterative Flow Control 351
Chapter 25 Regular Expressions 369
Chapter 26 Signals and Status 389
PART VII Basic System Administration 407
Chapter 27 What Is System Administration? 409
Chapter 28 System Programming 417
Chapter 29 Managing Users and Groups 439
Chapter 30 Disks and Filesystem Management 457
Chapter 31 Installing and Managing Software 477
Chapter 32 Getting to Know the Kernel 501
Chapter 33 Managing Print Services 517
PART VIII Network Administration 541
Chapter 34 Introduction to Unix Networking 543
Contents at a Glance xi
2817cfm.qxd 11/20/00 10:03 AM Page xi
xii Contents at a Glance
Chapter 35 Network Interfaces and Routing 563
Chapter 36 The Distributed System 591
Chapter 37 Integrating Unix with Other Platforms 605
Chapter 38 Network Security 631
PART IX Administering Services 655
Chapter 39 Selecting a Suite of Services 657
Chapter 40 Electronic Mail 667
Chapter 41 USENET News 687
Chapter 42 World Wide Web Services 707
Chapter 43 Remote Access (inet) Services 743
Appendices 767
Appendix A Common Unix Commands 767
Appendix B Documentation and Resources 799
Appendix C Other Types of Unix 821
Glossary 832
Index 853
2817cfm.qxd 11/20/00 10:03 AM Page xii
CONTENTS
Introduction xxxvii
PART I Introducing Unix 1
1 History and Background of Unix 3What Is Unix? 5
All Versions of Unix Are Multiuser 6All Versions of Unix Are Multitasking 6All Versions of Unix Can Use the Same Commands 6What Does This Mean to the End User? 7
Creation and History of Unix 8The Story of C 8The Rise of Unix Derivations 9The Internet and Unix 9Unix Today 10
The Unix Philosophy 11Summary 12
2 Which Unix? 13The Fragmentation of Unix 14Differences between Unices 16Unix Versions Used in This Book 17
Linux 17FreeBSD 18Solaris 19
We GNU, Do You? 19Getting to Know GNU 20The Free Software Foundation 23If GNU’s Not Unix, What Is It? 23The Free Software Explosion 24The Meteoric Rise of Open Source 24Summary 26
2817cfm.qxd 11/20/00 10:03 AM Page xiii
xiv
3 Some Basic Unix Concepts 29Structure of a Unix System 30
The Kernel 30The Shell 31
Which Shell? 32The File System 33
Files and Directories 34Users 34
The Superuser 35Commands 35Summary 37
PART II Getting Started 39
4 Logging In and Looking Around 41Getting Access to Unix 42Logging In for the First Time 45Changing Your Password 49What Are These Files? 50Logging Out 52Summary 53
5 Navigating the Filesystem 55Where Are You? 56
Absolute vs. Relative Path Names 57Moving Around 57What’s Where? 58
/bin 59/etc 59/home 60/tmp 60/usr 60/usr/local 60/var 61
Summary 61
Contents
2817cfm.qxd 11/20/00 10:03 AM Page xiv
PART III Unix Desktop Environments 63
6 The X Window System: An Overview 65What Is the X Window System? 66Desktops and Window Managers 67
Window Managers 68Desktop Environments 69Which to Use? 70
The Structure of X 71How Does X Work? 72
Installing and Configuring X 73Basic X Configuration 74X Window System Problems 74
Summary 75
7 Advanced X Techniques 77Using X Applications over a Network 78
The DISPLAY Variable 79Fonts 81
Installing Fonts 81Linux 82FreeBSD 82Solaris 83
X Font Servers 83Building a Font Server 84Using a Font Server 84
Using International Fonts 85Colors 86
Default Colors 86Security 90
Using ssh 91Securing Ports 91The /etc/X0.hosts File 92
Using the xhost Client 93The xauth Program 93
X and Users with Disabilities 95Summary 96
Contents xv
2817cfm.qxd 11/20/00 10:03 AM Page xv
xvi
8 Window Managers 97Graphic Interfaces 99twm 100
Configuring twm 101IceWM 103
Configuring IceWM 104BlackBox 107
Configuring BlackBox 107fvwm 108
Configuring fvwm 109AfterStep 110
Configuring AfterStep 111WindowMaker 113
Configuring WindowMaker 114Enlightenment 116
Configuring Enlightenment 118Installing Themes 118
Summary 120
9 KDE 121What Is KDE? 122Getting and Installing KDE 123
Downloading KDE 124Base Package Downloads 124Recommended Package Downloads 125
Unpacking the Source Code 126Compiling and Installing the Source Code 127Configuring X for KDE 128
The KDE Panel 129Virtual Desktops 133
The KDE File Manager 134The KDE Control Center 137
Desktop 138Background 138Borders 138Display 139Fonts 139Desktop Icons 139
Contents
2817cfm.qxd 11/20/00 10:03 AM Page xvi
Language 139Screensaver 140Style 140
Information 140Input Devices 140
International Keyboard 141Keyboard 141Mouse 141
Keys 141Global Keys 142Standard Keys 142
Network 143Sound 143Windows 143
Advanced 143Buttons 144Mouse 144Properties 144Titlebar 144
Password 144Date & Time 144Printers 145
Desktop Themes 145Summary 147
10 Gnome 149What Is Gnome? 150Getting and Installing Gnome 151
Downloading Gnome 152Base Library Downloads 152Core Application Downloads 153Additional Source Downloads 153
Unpacking the Source Code 154Compiling and Installing the Source Code 155Configuring X for Gnome 157
Using Gnome 159The Gnome Panel 159The Main Menu 160
Contents xvii
2817cfm.qxd 11/20/00 10:03 AM Page xvii
xviii
Application Launchers 165Applets 167The File Manager 167The Gnome Control Center 169Themes and the Desktop 171
Summary 173
PART IV Using the Shell 175
11 Introduction to the Bourne (Again) Shell 177Why Bourne Shell? 179
Bourne Shell vs. Bourne Again Shell 180Some Common Shell Commands 181
ls 182pwd 184cd 184mv 185cp 185cat 186more and less 186echo 187grep 187
Summary 188
12 Manipulating Files and Directories 189Creating and Editing Files 190Copying Files 193Moving Files 193File Ownership and Permissions 195
Who Owns the File? 195Who Can See the File? 196
Deleting Files 197Managing Directories 198
Creating Directories 198Directory Ownership and Permissions 199Deleting Directories 199
Summary 200
Contents
2817cfm.qxd 11/20/00 10:03 AM Page xviii
13 Customizing the Shell Environment 201Elements of Shell Configuration 203Run Control Files 204
.bash_profile 205Environment Variables 207
Common Environment Variables and What They’re For 209$USER 209$MAIL 210$PS1 210$HOSTNAME 212$PATH 212
Summary 213
14 Input and Output Redirection 215Standard Input and Output 216Introducing Redirection 217Redirection Operators 218
Output Redirection Operators 218Input Redirection Operators 219Combining Input and Output Redirection Operators 221
Pipes 222Command Substitution 223Combining Operators 225Summary 226
15 Other Shells 227The Bourne Shell 228The Korn Shell 229
Korn Shell Run Control Files 230Environment Variables 231pdksh 233
The C Shells 233C Shell Run Control Files 233Environment Variables 234What’s the Difference? 236
The Z Shell 237Other Shells 238
scsh 238
Contents xix
2817cfm.qxd 11/20/00 10:03 AM Page xix
xx
rc and es 238The Perl Shell 238
Summary 239
PART V Using Text Editors 241
16 The ed Editor 243What Is ed? 244Starting ed 245Reading a File 247Editing a File 248
Inputting Text 248Deleting Text 250Moving Text 250Joining Lines 250
Saving and Quitting 251Editing by Content 252
Matching 252Substitution 253
Summary 254
17 The vi Editor 255The One True Editor 256vi’s Modes 257Basic Editing in Command Mode 258
Moving the Cursor 258Deleting Text 260Pattern Matching and Replacing 261
Using the Shell within vi 262Abbreviations 263Macros 264The set Command 265The .exrc File 266Saving and Exiting 267Summary 268
Contents
2817cfm.qxd 11/20/00 10:03 AM Page xx
18 GNU Emacs 269What Is GNU Emacs? 270Running emacs 271emacs Peculiarities 271
Data Structures 272Key Bindings 273
Getting Started with emacs 274Dealing with Buffers 275Dealing with Windows 276The GNU Emacs Window 278
The Mode Line 279The Mini Buffer 279
Getting Help 279Backups and Auto-Save 280Killing and Yanking Text 281Searching and Replacing 281Saving and Exiting 282Doctor 282Summary 283
19 pico, joe, and jed 285pico 286
Starting pico 287Editing Text in pico 287
joe 289jed 293
jed’s Run Control Files 293Running jed 295
Summary 296
20 Graphical Text Editors 297Why Graphical Editors? 298NEdit 299KEdit 305
The KEdit Toolbar 306The Menu Bar 306
gEdit 307Summary 309
Contents xxi
2817cfm.qxd 11/20/00 10:03 AM Page xxi
xxii
PART VI Shell Programming 311
21 An Introduction to Shell Programming 313Why Program the Shell? 314What Is a Script and What Is a Program? 315Parts of a Program 316
Statements 317Operators 317Regular Expressions 318Variables 318Comments 319
Summary 320
22 Variables 321What Is a Variable? 322
Variable Names 323Variable Types 324
Arrays 326Integers 327
The $ Operator 328Assigning Values to Variables 329
Taking Input from the Keyboard 330Special Variables 330Summary 332
23 Flow Control, Part I: Conditional Flow Control 333The if-then Statement 335Evaluating Variables 336Evaluating Non-Variables 338
The test Command 339Commands 340
Evaluating Multiple Conditions 341Building an Example 342Extending the if-then Statement with else 344The elif Statement 345The case Statement 347
Taking Arguments from the Command Line 348Summary 350
Contents
2817cfm.qxd 11/20/00 10:03 AM Page xxii
24 Flow Control, Part II: Iterative Flow Control 351The for Statement 352
Command-Line Processing 353Building an Example with for 354
The select Statement 356The while Loop 360The until Loop 362Nesting Loops 363Summary 367
25 Regular Expressions 369How Regular Expressions Work 371
Using Metacharacters 372Alternative grep Syntax 373
More about grep 373sed 375
Writing sed Scripts 376Comments 376Line Addresses 377
sed Commands 377Substitution Commands 377Deletion Commands 378Commands for Appending, Inserting, and Changing 378
A sed Script Example 379Using sed on the Command Line 380Using sed in Shell Scripts 381
awk 382awk Metacharacters 386Printing in awk 387
Summary 387
26 Signals and Status 389Exit Status 390Managing Status 392
Reporting Status 392Accessing Status 393
The Explicit Method 393The Implicit Method 394
Building an Example 395
Contents xxiii
2817cfm.qxd 11/20/00 10:03 AM Page xxiii
xxiv
Signals 397Unique Identifiers 397Managing Signals 399
Sending Signals 399Signal Traps 402Ignoring Signals 404
Summary 405
PART VII Basic System Administration 407
27 What Is System Administration? 409The Administrator’s Job 410Administering a Small System 411Professional System Administration 413Basic System Administration Tasks 413
System Programming 414Managing Users 414Managing Disks and Filesystems 414Managing Software 415Managing the Kernel 415Managing Print Services 416
Summary 416
28 System Programming 417Automating Common Tasks with Shell Scripts 418Case Study: A Simple Backup Script 419
Adapting the Script for Multiple Backups 421Adapting the Script for Future Flexibility 422Adapting the Script to Include Logs 423
Executing Scripts with cron and at 426The cron Command 427crontab Syntax 428The at Command 428
init Scripts 429The Initialization Process 431
The System V Initialization Process 432The BSD Initialization Process 436
Summary 437
Contents
2817cfm.qxd 11/20/00 10:03 AM Page xxiv
29 Managing Users and Groups 439The Root Account 440
Accessing Superuser Powers 442Superuser Powers with the Root Password 442Superuser Powers without the Root Password 443
Adding New Users 445Creating Accounts with Linux and FreeBSD 448Creating Accounts with Solaris 449
Alternate Password Schemes 450Removing Users 451
Removing Users with Linux and FreeBSD 452Removing Users with Solaris 453
Groups 453Groups with Solaris 455
Adding a Group 455Modifying a Group 455Deleting a Group 456
Summary 456
30 Disks and Filesystem Management 457What Is a Disk? 458
Hard and Floppy Disks 459Optical Disks 459Other Types of Disks 460
Disk Partitions 461How to Create Disk Partitions 462Disk Partitions under Linux 463Disk Partitions under FreeBSD 464Disk Partitions under Solaris 467
Physical Media vs. Filesystems 468Mounting Local Partitions 470Automatic Mounting 471
Automatic Mounting under Linux and FreeBSD 471Automatic Mounting under Solaris 472
Mounting Remote Partitions 473Mounting Remote Directories under Linux and FreeBSD 474Mounting Remote Directories under Solaris 474
Summary 475
Contents xxv
2817cfm.qxd 11/20/00 10:03 AM Page xxv
xxvi
31 Installing and Managing Software 477Software Formats 478Compiling Software from Source Code 480
Configuring the Package 482Building the Package 482Installing the Package 483
Software Management for Unix Variants 484Linux 485
dpkg: Debian Package Manager 486dselect: A Graphical dpkg Interface 487rpm: Red Hat Package Manager 488
FreeBSD 492Installing a Port 493Removing a Port 494Finding Ports 494
Solaris 495Installing with pkgadd 495Removing with pkgrm 496
Keeping Up with Upgrades 497Summary 498
32 Getting to Know the Kernel 501What the Kernel Does 502Kernel Development 503Modules vs. Static Kernels 504(Re)Compiling the Kernel under Linux and FreeBSD 506
Recompiling a Linux Kernel 507Recompiling a FreeBSD Kernel 512
Users of a Nonupgraded Version of FreeBSD 513Users Who Have Upgraded Their Source Tree 515
Summary 515
33 Managing Print Services 517Unix and Printers 518BSD Printing: Linux and FreeBSD 520System V Printing: Solaris 520Adding Local Printers 521
Adding a Local Printer with FreeBSD and Linux 522
Contents
2817cfm.qxd 11/20/00 10:03 AM Page xxvi
Adding a Local Printer with Solaris 524Using admintool 525
Adding Network Printers 525Adding a Network Printer with FreeBSD 526Adding a Network Printer with Linux 527
Red Hat’s printtool 528Adding a Network Printer with Solaris 530
Network Printers with Solaris 2.5 and Earlier 531Network Printers with Solaris 2.6 and Newer 531Using admintool 531
Removing a Printer 532Removing a Printer with BSD 532Removing a Printer with Linux 532Removing a Printer with Solaris 533
Maintaining a Print Queue 533Print Queues with FreeBSD and Linux 534Print Queues with Solaris 534
Handling PostScript 535The Common Unix Printing System 538Summary 540
PART VIII Network Administration 541
34 Introduction to Unix Networking 543Basic Networking Concepts 545Basic TCP/IP 547
Internet Protocol 548Static and Dynamic IP 549
Networking Hardware and Software 550Common Networking Architectures 552
Local Area Network Topologies 553Ring Architecture 553Hub Architecture 554Bus Architecture 555
Wide Area Network Topologies 557Common Networking Concerns 559Summary 561
Contents xxvii
2817cfm.qxd 11/20/00 10:03 AM Page xxvii
xxviii
35 Network Interfaces and Routing 563Configuring Network Devices 564Dial-Up Networking 565
Dial-Up Hardware 567Case Study: Kppp 568
Writing a Login Script 575Dial-Up and FreeBSD 575Dial-Up and Solaris 577
Ethernet Networking 577DHCP and PPPoE 582
Routers and Gateways 582Small Networks 584IP Masquerading 585
IP Masquerading with FreeBSD 586IP Masquerading with Linux 587
Summary 588
36 The Distributed System 591Clients and Servers 592
Multiple-Service Machines 594A Multiple-Service Case Study 594
Distributing Services across Multiple Machines 597Backing Up Multiple Machines 599The Security Advantage 601
Reinforcing Multiple-Server Security 602Summary 603
37 Integrating Unix with Other Platforms 605Integrating One Unix with Other Unices 607
Obtaining and Installing NFS 608Configuring an NFS Server 609Mounting Networked File Systems 610Automatic Mounting with /etc/fstab 611
Integrating Unix and Windows 613Obtaining and Installing Samba 613Configuring Samba 614
Contents
2817cfm.qxd 11/20/00 10:03 AM Page xxviii