Tải bản đầy đủ (.pdf) (76 trang)

Ubuntu The Complete Reference phần 1 pptx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (13.05 MB, 76 trang )

Ubuntu
®

The Complete Reference
Richard Petersen
New York Chicago San Francisco
Lisbon London Madrid Mexico City
Milan New Delhi San Juan
Seoul Singapore Sydney Toronto
Copyright © 2009 by The McGraw-Hill Companies. All rights reserved. Manufactured in the United States of America. Except as
permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by
any means, or stored in a database or retrieval system, without the prior written permission of the publisher.
0-07-164368-0
The material in this eBook also appears in the print version of this title: 0-07-159846-4.
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked
name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the
trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training
programs. For more information, please contact George Hoare, Special Sales, at or (212) 904-4069.
TERMS OF USE
This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work.
Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one
copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, trans-
mit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the
work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be
terminated if you fail to comply with these terms.
THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO
THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUD-
ING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND
EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WAR-


RANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant
or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free.
Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in
the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through
the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, conse-
quential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the
possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises
in contract, tort or otherwise.
DOI: 10.1036/0071598464
To my cousins, Ken and Carolyn
About the Author
Richard Petersen, MLIS, teaches UNIX and C/C++
courses at the University of California at Berkeley. He
is the author of Linux: The Complete Reference (all six
editions), Red Hat Enterprise and Fedora Linux: The
Complete Reference, Red Hat Linux, Linux Programming,
Red Hat Linux Administrator’s Reference, Linux
Programmer’s Reference, Introductory C with C++,
Introductory Command Line Unix for Users, and many
other books. He is a contributor to linux.sys-con.com
(Linux World Magazine) with articles on IPv6, Fedora
operating system, Yum, Fedora repositories, the
Global File System (GFS), udev device management,
and the Hardware Abstraction Layer (HAL).
About the Technical Editor
Ibrahim Haddad is director of technology at
Motorola, Inc., where he is responsible for defining
and developing the requirements for Motorola’s open
source initiatives. Prior to his work at Motorola, he
managed the Carrier Grade Linux and Mobile Linux

Initiatives at the Open Source Development Lab
(OSDL), which included promoting the development
and adoption of Linux and open source software in
the communications industry. Prior to joining OSDL,
he was a senior researcher at the Research &
Innovation Department of Ericsson’s Corporate Unit
of Research. He is contributing editor of the Linux
Journal and the Enterprise Open Source Magazine.
Haddad received his B.Sc. and M.Sc. degrees in
Computer Science from the Lebanese American
University, and earned his Ph.D. in Computer Science
from Concordia University in Montreal, Canada. In
2000, he was awarded by Concordia University both
the J. W. McConnell Memorial Graduate Fellowship
and the Concordia University 25th Anniversary
Fellowship in recognition for academic excellence. In
2007, he was the winner of the Big Idea Innovation
Award in Recognition of Leadership and Vision at
Motorola Inc.
Copyright © 2009 by The McGraw-Hill Companies. Click here for terms of use.
Contents at a Glance
Part I Getting Started
1 Introduction to Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Installing Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3 Interface Basics: Login, Desktop, and Help . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Part II Confi guration
4 Administration Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5 Network Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
6 Software Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
7 Software Management with DEB, APT, and dkpg . . . . . . . . . . . . . . . . . . . . 123

Part III Desktops
8 GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
9 KDE, KDE 4, and Xfce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Part IV Using the Shell
10 The Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
11 Shell Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
12 Files, Directories, and Archives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Part V Applications
13 Offi ce and Database Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
14 Graphics Tools and Multimedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
15 Mail and News Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
16 Web Browsers, FTP, Java, VoIP, and IM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Part VI Security
17 Authorization, Encryption, and Permissions . . . . . . . . . . . . . . . . . . . . . . . . . 359
18 AppArmor and Security-Enhanced Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
19 Secure Shell and Kerberos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
20 Firewalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
v

vi
Ubuntu: The Complete Reference
Part VII System Administration
21 Basic System Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
22 Managing Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
23 File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
24 RAID and LVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
25 Devices and Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
26 Backup Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
27 Administering TCP/IP Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Part VIII Local Services

28 Managing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
29 Print, News, and Database Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
30 Shared Resources: Samba and NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
A Obtaining the Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
Contents
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Part I Getting Started
1 Introduction to Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Ubuntu Releases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Open Source Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Ubuntu Editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Ubuntu 8.04 LTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Ubuntu LiveCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Ubuntu Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Ubuntu Help and Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
help.ubuntu.com . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
ubuntuforums.org . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
ubuntuguide.org . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Ubuntu News and Blog Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Linux Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
History of Linux and Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2 Installing Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Install CD and DVDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Installation Choices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Installing Dual-Boot Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Hardware, Software, and Information Requirements . . . . . . . . . . . . . . . . . . . 19
Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Hard Drive Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Hardware and Device Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Installing Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Installation Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Starting the Installation Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Startup Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Selecting and Editing GRUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Login and Logout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Initial Confi guration Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
viivii
For more information about this title, click here

viii
Ubuntu: The Complete Reference
Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Reinstalling the Boot Loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Alternate Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Server Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Automating Installation with Kickstart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Wubi: Windows-Based Installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3 Interface Basics: Login, Desktop, and Help . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Accessing Your Linux System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
The GNOME Display Manager: GDM . . . . . . . . . . . . . . . . . . . . . . . . . 42
The User Switcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Accessing Linux from the Command Line Interface . . . . . . . . . . . . . . 44
The Ubuntu Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
GNOME Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

GNOME Applets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Desktop Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
International Clock: Time, Date, and Weather . . . . . . . . . . . . . . . . . . . 49
Confi guring Personal Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Desktop Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Using Removable Devices and Media . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Accessing File Systems, Devices, and Remote Hosts . . . . . . . . . . . . . 53
Burning DVDs and CDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Search Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Tracker: Indexed Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Search for Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
GNOME File Manager Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
GNOME Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Using the Command Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Help Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Ubuntu Help Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Context-Sensitive Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Application Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Man Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Info Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Running Windows Software on Linux: Wine . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Part II Confi guration
4 Administration Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Ubuntu Administrative Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Controlled Administrative Access: PolicyKit, sudo, and gksu . . . . . . . . . . . 71
PolicyKit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
gksu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
sudo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Login Window Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Contents

ix
Display Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Manual Display Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Confi guring Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Printer Management and Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Sound Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Multimedia Support: MP3, DVD-Video, DivX, and HDTV . . . . . . . . . . . . . . 80
File System Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Access Linux File Systems on Internal Drives . . . . . . . . . . . . . . . . . . . 81
Access for Local Windows NTFS File Systems . . . . . . . . . . . . . . . . . . 82
Access to Local Network Windows NTFS File Systems . . . . . . . . . . . 82
Shared Folders for Your Network and Windows: NFS and Samba . . . 82
Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Bluetooth Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
System Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Virus Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Accessing Devices Remotely . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Managing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Testing Hardware: Launchpad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5 Network Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
NetworkManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
NetworkManager on GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
NetworkManager for KDE: KNetworkManager . . . . . . . . . . . . . . . . . 93
Wireless Manual Confi guration and Editing . . . . . . . . . . . . . . . . . . . . 93
Manual Network Confi guration with network-admin . . . . . . . . . . . . . . . . . . 94
Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Command Line PPP Access: WvDial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

Manual Wireless Confi guration with iwconfi g . . . . . . . . . . . . . . . . . . . . . . . . 97
Accessing Remote Desktops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Virtual Network Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Windows Terminal Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6 Software Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Installing Software Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Ubuntu Package Management Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Updating Ubuntu with Update Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Managing Packages with Add/Remove Applications . . . . . . . . . . . . . . . . . . 109
Synaptic Package Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Installing Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Removing Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Search Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Synaptic Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

x
Ubuntu: The Complete Reference
Ubuntu Software Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Repository Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Software Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Ubuntu Repository Confi guration File: sources.list . . . . . . . . . . . . . . 120
7 Software Management with DEB, APT, and dkpg . . . . . . . . . . . . . . . . . . . . 123
Software Package Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
DEB Software Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Managing Software with APT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Upgrading with apt-get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Source Code Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Managing Non-repository Packages with dpkg . . . . . . . . . . . . . . . . . . . . . . . 127

Using Packages with Other Software Formats . . . . . . . . . . . . . . . . . . . . . . . . . 128
Command Line Search and Information: dpkg-query
and atp-cache Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Installing Software from Compressed Archives: .tar.gz . . . . . . . . . . . . . . . . . 130
Decompressing and Extracting Software in One Step . . . . . . . . . . . . 130
Decompressing Software Separately . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Selecting an Install Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Extracting Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Compiling Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Confi gure Command Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Development Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Shared and StaticLibraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Makefi le File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Checking Software Package Digital Signatures . . . . . . . . . . . . . . . . . . . . . . . . 135
Importing Software Public Keys with apt-key . . . . . . . . . . . . . . . . . . . 135
Checking Software Compressed Archives . . . . . . . . . . . . . . . . . . . . . . 136
Part III Desktops
8 GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
GNOME 2.22 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
GNOME Desktop Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
GNOME Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
GNOME Administration Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
GNOME File Manager Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
GTK+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
The GNOME Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
GNOME Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Quitting GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
GNOME Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
The GNOME Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Drag-and-Drop Files to the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

Contents
xi
Applications on the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
GNOME Desktop Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Window Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
GNOME Desktop Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
The GNOME File Manager: Nautilus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Home Folder Subdirectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Nautilus Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Nautilus Side Pane: Tree, History, and Notes . . . . . . . . . . . . . . . . . . . . 158
Displaying Files and Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Nautilus Pop-up Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Navigating Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Managing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Application Launcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Preferred Applications for Web, Mail, Accessibility,
and Terminal Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Default Applications for Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
File and Directory Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Nautilus Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Nautilus as an FTP Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Removable Drives and Network Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
The GNOME Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Panel Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Panel Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
GNOME Applets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Workspace Switcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
GNOME Window List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
GNOME Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
GNOME User Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

The GConf Confi guration Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
9 KDE, KDE 4, and Xfce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
KDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
The KDE Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
KDE Desktop Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Confi guration and Administration Access with KDE . . . . . . . . . . . . . 182
Confi guring Your Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
KDE Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Virtual Desktops: The KDE Desktop Pager . . . . . . . . . . . . . . . . . . . . . 184
KDE Panel: Kicker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
The KDE Help Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Mounting Devices from the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
KDE File Managers: Konqueror and Dolphin . . . . . . . . . . . . . . . . . . . . . . . . . 188
Basic File Manager Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Copy, Move, Delete, Rename, and Link Operations . . . . . . . . . . . . . . 189

xii
Ubuntu: The Complete Reference
Dolphin File Manager: Kubuntu 3 and 4 . . . . . . . . . . . . . . . . . . . . . . . 190
Konqueror File Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
KDE Confi guration: System Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
.kde and Desktop User Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
KDE Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
KDE 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
KDE 4 Desktop and File Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Xfce4 Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Part IV Using the Shell
10 The Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Accessing Shells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

The Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Command Line Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Command and Filename Completion . . . . . . . . . . . . . . . . . . . . . . . . . . 207
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
History Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
History Event Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Confi guring History: HISTFILE and HISTSIZE . . . . . . . . . . . . . . . . . . 212
Filename Expansion: *, ?, [ ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Matching Multiple Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Matching Single Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Matching a Range of Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Matching Shell Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Generating Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Standard Input/Output and Redirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Redirecting the Standard Output: > and >> . . . . . . . . . . . . . . . . . . . . . 217
The Standard Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Pipes
|
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Redirecting and Piping the Standard Error: >&, 2> . . . . . . . . . . . . . . . . . . . . 220
Jobs: Background, Kills, and Interruptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Running Jobs in the Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Referencing Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Job Notifi cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Bringing Jobs to the Foreground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Canceling Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Suspending and Stopping Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Ending Processes: ps and kill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Shell Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Defi nition and Evaluation of Variables: =, $, set, unset . . . . . . . . . . . 225

Values from Linux Commands: Back Quotes . . . . . . . . . . . . . . . . . . . . 226
Shell Scripts: User-Defi ned Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Executing Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Contents
xiii
Script Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Test Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Conditional Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Loop Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Filters and Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Searching Files: grep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11 Shell Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Shell Initialization and Confi guration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Confi guration Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Aliasing Commands and Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Aliasing Commands and Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Aliasing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Controlling Shell Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Environment Variables and Subshells: export . . . . . . . . . . . . . . . . . . . . . . . . . 242
Confi guring Your Shell with Shell Parameters . . . . . . . . . . . . . . . . . . . . . . . . 242
Shell Parameter Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Confi guring Your Login Shell: .profi le . . . . . . . . . . . . . . . . . . . . . . . . . 249
Confi guring the BASH Shell: .bashrc . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
The BASH Shell Logout File: .bash_logout . . . . . . . . . . . . . . . . . . . . . . 254
12 Files, Directories, and Archives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Linux Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
The File Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257

Home Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Pathnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
System Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Listing, Displaying, and Printing Files: ls, cat, more, less, and lpr . . . . . . . . 260
Displaying Files: cat, less, and more . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Printing Files: lpr, lpq, and lprm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Managing Directories: mkdir, rmdir, ls, cd, and pwd . . . . . . . . . . . . . . . . . . . 261
Creating and Deleting Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Displaying Directory Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Moving Through Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Referencing the Parent Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
File and Directory Operations: fi nd, cp, mv, rm, and ln . . . . . . . . . . . . . . . . . 264
Searching Directories: fi nd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Copying Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Moving Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Copying and Moving Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Erasing Files and Directories: The rm Command . . . . . . . . . . . . . . . . 269
Links: The ln Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

xiv
Ubuntu: The Complete Reference
Archiving and Compressing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Archiving and Compressing Files with File Roller . . . . . . . . . . . . . . . 272
Archive Files and Devices: tar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
File Compression: gzip, bzip2, and zip . . . . . . . . . . . . . . . . . . . . . . . . . 277
Part V Applications
13 Offi ce and Database Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Running Microsoft Offi ce on Linux: CrossOver and Wine . . . . . . . . . . . . . . 284
OpenOffi ce.org . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
KOffi ce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

KOffi ce Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
KParts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
GNOME Offi ce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Document Viewers (PostScript, PDF, and DVI) . . . . . . . . . . . . . . . . . . . . . . . . 290
PDA Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
GNOME Editor: Gedit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
KDE Editors: Kate and KEdit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
The Emacs Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
The Vi Editor: Vim and Gvim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Database Management Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
OpenOffi ce.org Base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
SQL Databases (RDMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
XBase Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
14 Graphics Tools and Multimedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Graphics Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Photo Management Tools: F-Spot and digiKam . . . . . . . . . . . . . . . . . 302
GNOME Graphics Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
KDE Graphics Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
X Window System Graphic Programs . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Multimedia Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Ubuntu Codec Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
GStreamer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Sound Drivers and Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Connection Confi guration: GNOME Volume Control . . . . . . . . . . . . 310
PulseAudio and Sound Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Music Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
CD/DVD Burners and Rippers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Video Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
15 Mail and News Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321

Mail Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
MIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Contents
xv
Thunderbird . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
The K Desktop Mail Client: KMail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
SquirrelMail Webmail Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Command Line Mail Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Notifi cations of Received Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Accessing Mail on Remote POP Mail Servers . . . . . . . . . . . . . . . . . . . 330
Mailing Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Usenet News . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Newsreaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
16 Web Browsers, FTP, Java, VoIP, and IM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Web Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Web Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Firefox: The Mozilla Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
The K Desktop File Manager: Konqueror . . . . . . . . . . . . . . . . . . . . . . . 345
GNOME Web Browsers: Epiphany, Galeon, and Kazehakase . . . . . . 345
Lynx and ELinks: Line-Mode Browsers . . . . . . . . . . . . . . . . . . . . . . . . 345
Java for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
FTP Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Network File Transfer: FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Web Browser–Based FTP: Firefox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
The KDE File Managers: Konqueror and Dolphin . . . . . . . . . . . . . . . 348
GNOME Desktop FTP: Nautilus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
gFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
wget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
curl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349

ftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Automatic Login and Macros: .netrc . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
lftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Network Talk and Messenger Clients: VoIP, IRC, and IM . . . . . . . . . . . . . . . 354
Ekiga . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Instant Messenger: Pidgin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Part VI Security
17 Authorization, Encryption, and Permissions . . . . . . . . . . . . . . . . . . . . . . . . . 359
Controlled Access with PolicyKit: Authorizations . . . . . . . . . . . . . . . . . . . . . 359
PolicyKit Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
PolicyKit Confi guration Files and Tools . . . . . . . . . . . . . . . . . . . . . . . . 364
Public Key Encryption, Digital Signatures, and Integrity Checks . . . . . . . . 364
Public Key Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Digital Signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Integrity Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Combining Encryption and Signatures . . . . . . . . . . . . . . . . . . . . . . . . . 366

xvi
Ubuntu: The Complete Reference
Managing Keys with Seahorse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Passwords and Encryption Keys: Seahorse . . . . . . . . . . . . . . . . . . . . . 367
Seahorse Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Making Your Public Keys Available with Seahorse . . . . . . . . . . . . . . . 371
GNU Privacy Guard: gpg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Generating Your Public Key with gpg . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Importing Public Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Signing Your Public Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Publishing Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Using GPG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Encrypting and Decrypting Data with the gpg Command . . . . . . . . 378

Seahorse Plug-ins: Choose Recipients . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Signing Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Permissions: Discretionary Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Read, Write, and Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Permissions on GNOME and KDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
chmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Ownership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Changing a File’s Owner or Group: chown and chgrp . . . . . . . . . . . . 386
Setting Permissions: Permission Symbols . . . . . . . . . . . . . . . . . . . . . . 386
Absolute Permissions: Binary Masks . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Directory Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Ownership Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Sticky Bit Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Permission Defaults: umask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Access Control Lists: FACL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
Encrypted File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Intrusion Detection: Tripwire and AIDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
18 AppArmor and Security-Enhanced Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
AppArmor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
AppArmor Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
AppArmor Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Security Enhanced Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Flask Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
System Administration Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Management Operations for SELinux . . . . . . . . . . . . . . . . . . . . . . . . . . 404
SELinux Management Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
The SELinux Reference Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
SELinux Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
SELinux Policy Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408

SELinux Policy Confi guration Files and Modules . . . . . . . . . . . . . . . . 410
SELinux: Administrative Operations . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Contents
xvii
19 Secure Shell and Kerberos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
The Secure Shell: OpenSSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
SSH Encryption and Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
SSH Packages, Tools, and Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
SSH Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
SSH Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Port Forwarding (Tunneling) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
SSH Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Kerberos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Kerberos Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Authentication Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Kerberized Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
Kerberos Servers and Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
20 Firewalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Uncomplicated Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Firestarter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
iptables, NAT, Mangle, and ip6tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
iptables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
ip6tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Packet Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Firewall and NAT Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Adding and Changing Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
iptables Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438

Accepting and Denying Packets: DROP and ACCEPT . . . . . . . . . . . . 438
User-Defi ned Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
ICMP Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Controlling Port Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Packet States: Connection Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Specialized Connection Tracking: ftp, irc, Amanda, tftp . . . . . . . . . . 443
Network Address Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
Adding NAT Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
NAT Targets and Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
NAT Redirection: Transparent Proxies . . . . . . . . . . . . . . . . . . . . . . . . . 445
Packet Mangling: The Mangle Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
IP Masquerading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Part VII System Administration
21 Basic System Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Ubuntu Administrative Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449

xviii
Ubuntu: The Complete Reference
Administrative Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Controlled Administrative Access with PolicyKit . . . . . . . . . . . . . . . . 451
Controlled Administrative Access with gksu and sudo . . . . . . . . . . . 452
Full Administrative Access with root, su, and superuser . . . . . . . . . . 455
Editing User Confi guration Files Directly . . . . . . . . . . . . . . . . . . . . . . 456
Administrative Access from the File Browser . . . . . . . . . . . . . . . . . . . 457
System Time and Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Using the time-admin Date and Time Utility . . . . . . . . . . . . . . . . . . . . 458
Using the date Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Scheduling Tasks with cron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
crontab Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
Environment Variables for cron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460

The cron.d Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
The crontab Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Editing in cron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Organizing Scheduled Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Running cron Directory Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
cron Directory Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
Anacron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
System Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Program Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Confi guration Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
System Logs: /var/log and syslogd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
syslogd and syslog.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Entries in syslogd.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Actions and Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Performance Analysis Tools and Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
GNOME System Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
The ps Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
vmstat, top, free, Xload, iostat, and sar . . . . . . . . . . . . . . . . . . . . . . . . . 471
SystemTap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
GNOME Power Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
GKrellM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
KDE Task Manager and Performance Monitor (KSysguard) . . . . . . . 472
Grand Unifi ed Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Virtual Machine Manager: virt-manager . . . . . . . . . . . . . . . . . . . . . . . 477
KVM Hardware Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Xen Virtualization Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
22 Managing Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
GUI User Management Tools: users-admin . . . . . . . . . . . . . . . . . . . . . . . . . . . 483

Create a New User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Manage Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Contents
xix
User Confi guration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
The Password Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
/etc/passwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
/etc/shadow and /etc/gshadow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Password Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Managing User Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Profi le Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
/etc/login.defs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Controlling User Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Adding and Removing Users and Groups with useradd,
usermod, and userdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
useradd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
usermod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
userdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Managing Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
/etc/group and /etc/gshadow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
User Private Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Group Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Managing Groups Using groupadd, groupmod, and groupdel . . . . 493
Disk Quotas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Quota Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
edquota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
repquota and quota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Lightweight Directory Access Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
LDAP Confi guration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Confi guring the LDAP Server: /etc/ldap/slapd.conf . . . . . . . . . . . . 498

LDAP Directory Database: ldif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
LDAP Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Pluggable Authentication Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
PAM Confi guration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
PAM Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
23 File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
File Systems and Directory Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
File System Hierarchy Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
Root Directory: / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
System Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
The /usr Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
The /media Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
The /mnt Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
The /home Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
The /var Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
The /proc File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
The sysfs File System: /sys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Device Files: /dev, udev, and HAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511

xx
Ubuntu: The Complete Reference
Mounting File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
File System Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Journaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
ext3 Journaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
ext4 File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
ReiserFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Mounting File Systems Automatically: /etc/fstab . . . . . . . . . . . . . . . . . . . . . 519
HAL and fstab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
fstab Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520

Auto Mounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
mount Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Boot and Disk Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
fstab Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Partition Labels: e2label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
Windows Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
noauto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Mounting File Systems Manually: mount and umount . . . . . . . . . . . . . . . . . 525
The mount Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
The umount Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Managing CDs/DVDs, USB Drives, and Floppy Disks . . . . . . . . . . . 527
Mounting Hard Drive Partitions: Linux and Windows . . . . . . . . . . . 528
Mounting DVD/CD Disc Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Creating File Systems: mkfs, mke2fs, mkswap, parted, and fdisk . . . . . . . . 528
Parted and GParted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
Fdisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
mkfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
mkswap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
CD/DVD Disc Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Mono and .NET Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
24 RAID and LVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Logical Volume Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
LVM Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Creating LVMs During Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
system-confi g-lvm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Using the LVM Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
LVM Example for Multiple Hard Drives . . . . . . . . . . . . . . . . . . . . . . . 546
Using LVM to Replace Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
LVM Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
Confi guring RAID Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549

Motherboard RAID Support: dmraid . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Linux Software RAID Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
RAID Devices and Partitions: md and fd . . . . . . . . . . . . . . . . . . . . . . . 552
Booting from a RAID Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
RAID Administration: mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Creating and Installing RAID Devices . . . . . . . . . . . . . . . . . . . . . . . . . 553
Contents
xxi
25 Devices and Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
The sysfs File System: /sys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
The proc File System: /proc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
udev: Device Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
udev Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
Device Names and udev Rules: /etc/udev/rules.d . . . . . . . . . . . . . . 564
Symbolic Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
Persistent Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
Generated Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
Creating udev Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
SYMLINK Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
Manually Creating Persistent Names: udevinfo . . . . . . . . . . . . . . . . . 570
Permission Fields: MODE, GROUP, OWNER . . . . . . . . . . . . . . . . . . . 571
Hardware Abstraction Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
The HAL Daemon and hal-device-manager (hal-gnome) . . . . . . . . . 573
HAL Confi guration: /etc/hal/fdi and /usr/share/hal/fdi . . . . . . . 573
Device Information Files: fdi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
Device Information File Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Manual Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Installing and Managing Terminals and Modems . . . . . . . . . . . . . . . . . . . . . . 579
Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579

mingetty, mgetty, and getty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
Input Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
Installing Other Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Sound Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Video and TV Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
PCMCIA Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
Kernel Module Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
Module Files and Directories: /lib/modules . . . . . . . . . . . . . . . . . . . . 582
Managing Modules with modprobe and /etc/modules . . . . . . . . . . 583
The depmod Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
The modprobe Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
The insmod Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
The rmmod Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
modprobe Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Installing New Modules from Vendors: Driver Packages . . . . . . . . . 585
26 Backup Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Individual Backups: archive and rsync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
BackupPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
BackupPC Server Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
BackupPC Host Backup and Confi guration . . . . . . . . . . . . . . . . . . . . . 593

xxii
Ubuntu: The Complete Reference
Amanda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Amanda Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Amanda Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Enabling Amanda on the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Using Amanda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Backups with Dump and Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598

The dump Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Recording Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Operations with dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Recovering Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
27 Administering TCP/IP Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
TCP/IP Protocol Suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Zero Confi guration Networking: Avahi and Link Local Addressing . . . . . . 606
IPv4 and IPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
TCP/IP Network Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
IPv4 Network Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
Class-Based IP Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
Netmask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
Classless Interdomain Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
Obtaining an IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
Broadcast Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Gateway Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Name Server Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
IPv6 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
IPv6 Address Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
IPv6 Interface Identifi ers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
IPv6 Address Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
TCP/IP Confi guration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Identifying Hostnames: /etc/hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
/etc/resolv.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
/etc/services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
/etc/protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
/etc/network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
/etc/network/interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Network Autoconfi guration with IPv6, DHCPv6, and DHCP . . . . . . . . . . . 617
IPv6 Stateless Autoconfi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618

IPv6 Stateful Autoconfi guration: DHCPv6 . . . . . . . . . . . . . . . . . . . . . . 619
Linux as an IPv6 Router: radvd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
DHCP for IPv4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Domain Name Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
host.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
Network Interfaces and Routes: ifconfi g and route . . . . . . . . . . . . . . . . . . . . 625
Monitoring Your Network: EtherApe, Ping, Ettercap,
Wireshark, Tcpdump, and Netstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
Ping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
Contents
xxiii
Ettercap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
Wireshark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
Tcpdump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
Netstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Part VIII Local Services
28 Managing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
Upstart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
Upstart and Runlevels: event.d and init.d . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
Runlevels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
Runlevels in event.d directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
Using telinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
Default Runlevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
Command Line Runlevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
The runlevel Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
System Startup Files and Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
rc.local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
/etc/init.d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
/etc/init.d/rc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
/etc/event.d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640

Service Scripts: /etc/init.d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
Managing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
Managing Services Directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
Service Management: services-admin, rrconf, sysv-rc-conf,
and update-rc.d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
services-admin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
rcconf and sysv-rc-conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
update-rc.d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
Extended Internet Services Daemon (xinetd) . . . . . . . . . . . . . . . . . . . . . . . . . . 647
xinetd and inetd Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
xinetd Confi guration: xinetd.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
xinetd Service Confi guration Files: /etc/xinetd.d Directory . . . . . . . 648
Confi guring Services: xinetd Attributes . . . . . . . . . . . . . . . . . . . . . . . . 649
Disabling and Enabling xinetd Services . . . . . . . . . . . . . . . . . . . . . . . . 649
TCP Wrappers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
29 Print, News, and Database Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
Printer Services: CUPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
Printer Devices and Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
Printer Device Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
Spool Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
Installing Printers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
Confi guring Printers on Ubuntu with system-confi g-printer . . . . . . 657
Confi guring Printers with KDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661

xxiv
Ubuntu: The Complete Reference
CUPS Web Browser–based Confi guration Tool . . . . . . . . . . . . . . . . . . 661
Confi guring Remote Printers on CUPS . . . . . . . . . . . . . . . . . . . . . . . . . 663
CUPS Printer Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
CUPS Confi guration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666

cupsd.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
CUPS Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
CUPS Command Line Print Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
lpr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
lpc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
lpq and lpstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
lprm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
CUPS Command Line Administrative Tools . . . . . . . . . . . . . . . . . . . . . . . . . . 669
lpadmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
lpoptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
enable and disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
accept and reject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
News Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
Database Servers: MySQL and PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
Relational Database Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
30 Shared Resources: Samba and NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
Samba . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
Samba Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
Starting Samba . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
Firewall Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
Setting Up Samba with Confi guration Tools . . . . . . . . . . . . . . . . . . . . 681
Confi guring Samba Access from Windows . . . . . . . . . . . . . . . . . . . . . 684
User-Level Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
The Samba smb.conf Confi guration File . . . . . . . . . . . . . . . . . . . . . . . . 688
Testing the Samba Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
Accessing Samba Services with Clients . . . . . . . . . . . . . . . . . . . . . . . . 694
Network File Systems: NFS and /etc/exports . . . . . . . . . . . . . . . . . . . . . . . . . 697
Setting Up NFS Directories with shared-admin: Shared Folders . . . 698

NFS Confi guration: /etc/exports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
NFSv4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
Mounting NFS File Systems: NFS Clients . . . . . . . . . . . . . . . . . . . . . . . 701
Distributed Network File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
A Obtaining the Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705

×