Tải bản đầy đủ (.pdf) (1,010 trang)

IT training hill fedora core 7 and red hat enterprise linux the complete reference jun 2007

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 (12.86 MB, 1,010 trang )

Digitally
signed by
ayman21sa
Date:
2007.12.30
18:22:57
+02'00'


Fedora 7 & Red Hat Enterprise
Linux: The Complete Reference
TM

®

Richard Petersen

New York Chicago San Francisco
Lisbon London Madrid Mexico City
Milan New Delhi San Juan
Seoul Singapore Sydney Toronto


Copyright © 2007 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-151099-0
The material in this eBook also appears in the print version of this title: 0-07-148642-9.
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, transmit, 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, INCLUDING 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 WARRANTIES 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, consequential 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/0071486429


Professional

Want to learn more?
We hope you enjoy this
McGraw-Hill eBook! If
you’d like more information about this book,
its author, or related books and websites,
please click here.


To my nephews,
Dylan, Christopher, and Justin



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 the linux.syscon.com (LinuxWorld 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
Dr. Ibrahim Haddad is currently Director of
Embedded & Open Source Technology at Motorola.
In this role he is responsible for defining and
developing the requirements for Motorola Software
Group’s open source initiatives. Prior to Motorola,
Dr. Haddad 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. He
is the co-author of two books on Red Hat Linux and
Fedora, a contributing editor of the Linux Journal,
Linux Planet, and Enterprise Open Source Magazine,

and a featured speaker and panelist at industry
conferences such as Linux World, GlobalComm,
Ottawa Linux Symposium, and at academic
conferences hosted by IEEE, ACM, and USENIX. He
received his B.Sc. and M.Sc. in Computer Science
from the Lebanese American University, and his
Ph.D. in Computer Science from Concordia
University in Montreal, Canada.

Copyright © 2007 by The McGraw-Hill Companies. Click here for terms of use.


For more information about this title, click here

Contents
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi

Part I Getting Started
1

Introduction to Red Hat and Fedora Linux . . . . . . . . . . . . . . . . . . . . . . . . . .
Red Hat and Fedora Linux
.......................................
The Fedora Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Red Hat Enterprise Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CENTOS: Community Enterprise Operating System . . . . . . . . . . . . .
Red Hat and Fedora Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora Live CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Operating Systems and Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
History of Linux and Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linux Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Open Source Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linux Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora Software Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Third-Party Linux Software Repositories . . . . . . . . . . . . . . . . . . . . . . .
Linux Office and Database Software . . . . . . . . . . . . . . . . . . . . . . . . . . .
Internet Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Development Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Online Linux Information Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linux Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3
5
6
6
7
7
9
11
12
13
13
14
15
16
17

17
18
19
19
21
21
21

2

Installing Fedora . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Key Feature of Fedora Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Minimal Install Strategy with Desktop Spins:
Making Use of Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Minimal Install Strategy with Fedora Live CD: First Time Installs . . . . . . .
Obtaining the CDs and DVDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installation Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Install Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Install Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Install Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Dual-Boot Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simple Graphical Direct Install with DVD/CD-ROMs . . . . . . . . . . . . . . . . .
Hardware, Software, and Information Requirements . . . . . . . . . . . . . . . . . . .
Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hard Drive Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Information Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25
25
26

26
27
28
29
29
29
30
30
32
32
33
33

v


vi

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference

3

CD-ROM, Hard Disk, and Mouse Information . . . . . . . . . . . . . . . . . .
Network Configuration Information . . . . . . . . . . . . . . . . . . . . . . . . . . .
Boot Source Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Install Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Virtual Network Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Automating Installation with Kickstart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting the Installation Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Install Hardware Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initial Setup: Upgrade or Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Partitions, RAID, and Logical Volumes . . . . . . . . . . . . . . . . . . . . . . . .
Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Custom and Review Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Boot Loaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Software Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Finishing Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GRUB on Restart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Firewall and SELinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Date and Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hardware Profile Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Create User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sound Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Login and Logout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Boot Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rescue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Re-installing the Boot Loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Your Own Fedora Install Spins with Pungi . . . . . . . . . . . . . . . . . . .

33
34
34
35
36
36
37

38
39
39
39
40
40
43
43
44
44
46
46
47
47
47
48
48
48
48
49
49
50
50

Interface Basics: Login, Desktop, Help, Repositories,
Multimedia, and Spins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing Your Linux System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Display Manager: GDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The User Switcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Accessing Linux from the Command Line Interface . . . . . . . . . . . . . .
Shutting Down Linux from the Command Line . . . . . . . . . . . . . . . . .
The GNOME and KDE Desktops
...................................
Fedora Desktop
............................................
GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Applets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting a GUI from the Command Line . . . . . . . . . . . . . . . . . . . . . . . .
Desktop Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop Font Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Your Personal Information . . . . . . . . . . . . . . . . . . . . . . . .
Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Beagle: Searching files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

55
55
56
56
57
58
59
59
60
60
63
65
65

66
66
66
66
67
67


Contents

4

Accessing File Systems, Devices, and Remote Hosts . . . . . . . . . . . . .
Using Removable Devices and Media . . . . . . . . . . . . . . . . . . . . . . . . . .
Burning DVD/CDs with GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Multimedia Support: MP3, DVD, and DivX . . . . . . . . . . . .
Command Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context-Sensitive Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Man Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Info Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Web Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Fedora Software Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Repositories to Complete Your Installation . . . . . . . . . . . . . . .
Repository Incompatibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pirut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Yum Extender: yumex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Livna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Freshrpms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Some Popular Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Java Applications: jpackage.org . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Windows Access and Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Up Windows Network Access: Samba . . . . . . . . . . . . . . . . . . .
Running Windows Software on Linux: Wine . . . . . . . . . . . . . . . . . . . .

69
70
71
71
72
73
73
73
74
75
75
75
76
77
77
77
79
79
80
81
83
84
84

85

System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora Administrative Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Configuration Files Directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simple Administrative Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Login Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Printer Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Printers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Printers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Remote Printers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
X Window System Configuration: system-config-display and
Vendor Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
system-config-display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Video Graphics Card Driver Support: ATI, NVIDIA, and Livna . . .
Updating Fedora and Enterprise Linux: PUP and RHN . . . . . . . . . . . . . . . .
Installing Software Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing with Yum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pirut Package Manager: A Repository Model of
Software Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Third-Party Kernel Module Updates . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Packages Manually with the rpm Command . . . . . . . . . . .
Package Security Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Source Code Applications . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Authentication Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

89

90
90
92
93
93
94
95
96
98
99
99
100
102
103
104
105
106
107
109
110
111
112
113

vii


viii

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference


5

Unsupported Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Access for Local Windows NTFS File Systems . . . . . . . . . . . . . . . .
NTFS Read/Write Access: ntfs-3g . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NTFS Project Read-Only: Livna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DKMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bluetooth Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Personal Area Networks: PAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

114
115
115
116
117
117
117
118

Network Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Information: Dynamic and Static . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Configuration with Fedora Network Tools . . . . . . . . . . . . . . . . . . .
system-config-network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring New Network Devices Manually . . . . . . . . . . . . . . . . . .
Virtual Private Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interface Configuration Scripts:
/etc/sysconfig/network-scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Command Line PPP Access: wvdial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Manual Wireless Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iwconfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iwpriv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iwspy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iwlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
linux-wlan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Up Your Firewall: system-config-securitylevel
.................
InfiniBand Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring a Local Area Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

119
119
121
122
123
126
128
128
129
131
131
132
133
133
133
133
134
135


Part II Environments
6

GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora Desktop Look and Feel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME 2.x Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME 2.x Desktop Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME 2.x File Manager Features . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GTK+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The GNOME Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Quitting GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The GNOME Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drag and Drop Files to the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . .
Applications on the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Desktop Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Window Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The GNOME Volume Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The GNOME File Manager: Nautilus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nautilus Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nautilus Sidebar: Tree, History, and Notes . . . . . . . . . . . . . . . . . . . . .

139
140
141
141
143
143

144
145
146
146
146
146
147
148
148
149
150
151
152


Contents

7

Displaying Files and Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nautilus Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Navigating Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application Launcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File and Directory Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nautilus Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nautilus as a FTP Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The GNOME Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Panel Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Panel Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Special Panel Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Applets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace Switcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Window List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME User Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The GConf Configuration Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

153
153
153
154
157
157
158
159
159
160
162
164
164
165
165
165
166
166
166

The K Desktop Environment: KDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The Qt Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuration and Administration Access with KDE . . . . . . . . . . . . . . . . . . .
The KDE Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KDE Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Quitting KDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KDE Desktop Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing System Resources from the File Manager . . . . . . . . . . . . .
Configuring Your Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop Link Files and URL Locations . . . . . . . . . . . . . . . . . . . . . . . . .
KDE Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Virtual Desktops: The KDE Desktop Pager . . . . . . . . . . . . . . . . . . . . .
KDE Panel: Kicker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The KDE Help Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application Standard Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application Desktop Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting Devices from the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KDE File Manager and Internet Client: Konqueror . . . . . . . . . . . . . . . . . . . .
Konqueror Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Navigation Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Navigating Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Copy, Move, Delete, Rename, and Link Operations . . . . . . . . . . . . . .
Web and FTP Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Konqueror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KDE Configuration: KDE Control Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.kde and Desktop User Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MIME Types and Associated Applications . . . . . . . . . . . . . . . . . . . . . .
KDE Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


171
173
173
174
175
175
176
176
177
178
178
179
180
181
181
182
182
183
183
184
185
185
186
187
187
188
189
191
191
191


ix


x

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference

8

The Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command Line Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command and Filename Completion . . . . . . . . . . . . . . . . . . . . . . . . . .
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
History Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
History Event Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring History: HISTFILE and HISTSAVE . . . . . . . . . . . . . . . . .
Filename Expansion: *, ?, [ ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Matching Multiple Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Matching Single Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Matching a Range of Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Matching Shell Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Generating Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Standard Input/Output and Redirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Redirecting the Standard Output: > and >> . . . . . . . . . . . . . . . . . . . . .
The Standard Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pipes: | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Redirecting and Piping the Standard Error: >&, 2> . . . . . . . . . . . . . . . . . . . .
Jobs: Background, Kills, and Interruptions . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Running Jobs in the Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Referencing Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Job Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bringing Jobs to the Foreground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Canceling Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Suspending and Stopping Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ending Processes: ps and kill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Shell Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Definition and Evaluation of Variables: =, $, set, unset . . . . . . . . . . .
Values from Linux Commands: Back Quotes
...................
Shell Scripts: User-Defined Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Executing Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Script Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Test Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conditional Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Loop Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filters and Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Searching Files: grep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

193
193
195
196
197
198
200
201

201
203
203
204
204
205
205
206
208
209
210
211
212
212
212
213
213
213
214
214
215
216
217
217
218
219
219
221
223
224

225
225

9

Shell Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Aliasing Commands and Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Aliasing Commands and Arguments . . . . . . . . . . . . . . . . . . . . . . . . . .
Aliasing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Controlling Shell Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Environment Variables and Subshells: export . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Your Shell with Shell Parameters . . . . . . . . . . . . . . . . . . . . . . . .
Shell Parameter Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Your Login Shell: .bash_profile . . . . . . . . . . . . . . . . . . . .

227
228
228
229
229
230
230
231
233
238


Contents


10

Configuring the BASH Shell: .bashrc . . . . . . . . . . . . . . . . . . . . . . . . . . .
The BASH Shell Logout File: .bash_logout . . . . . . . . . . . . . . . . . . . . . .
Initialization and Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuration Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . .

242
243
244
245

Managing Linux Files and Directories: Directories, Archives,
and Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linux Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The File Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Home Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pathnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Listing, Displaying, and Printing Files: ls, cat, more, less, and lpr . . . . . . . .
Displaying Files: cat, less, and more . . . . . . . . . . . . . . . . . . . . . . . . . . .
Printing Files: lpr, lpq, and lprm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing Directories: mkdir, rmdir, ls, cd, and pwd . . . . . . . . . . . . . . . . . . .
Creating and Deleting Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying Directory Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Moving Through Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Referencing the Parent Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File and Directory Operations: find, cp, mv, rm, and ln . . . . . . . . . . . . . . . . .
Searching Directories: find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Copying Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Moving Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Copying and Moving Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Erasing Files and Directories: the rm Command . . . . . . . . . . . . . . . . .
Links: the ln Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The mtools Utilities: msdos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Archiving and Compressing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Archiving and Compressing Files with File Roller . . . . . . . . . . . . . . .
Archive Files and Devices: tar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Compression: gzip, bzip2, and zip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

247
248
250
250
251
252
252
254
254
255
256
256
256
257
257
258
259
262
263
263

263
265
266
266
267
272

Part III Applications
11

Office and Database Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Microsoft Office on Linux: CrossOver . . . . . . . . . . . . . . . . . . . . . . .
OpenOffice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KOffice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KOffice Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KParts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Document Viewers (PostScript, PDF, and DVI) . . . . . . . . . . . . . . . . . . . . . . . .
PDA Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Database Management Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SQL Databases (RDMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Xbase Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Editor: Gedit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
K Desktop Editors: Kate, KEdit, and KJots . . . . . . . . . . . . . . . . . . . . . .

277
278
279
280

281
282
282
284
284
285
286
287
288
289
289

xi


xii

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference

The Emacs Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Vi Editor: Vim and Gvim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

289
290

12

Graphics Tools and Multimedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Graphics Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Photo Management Tools: F-Spot and digiKam . . . . . . . . . . . . . . . . .

KDE Graphics Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Graphics Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
X Window System Graphic Programs . . . . . . . . . . . . . . . . . . . . . . . . . .
Multimedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GStreamer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sound Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CD Burners and Rippers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Video Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

295
295
295
297
297
297
298
299
301
302
302

13

Mail and News Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mail Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Thunderbird . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME Mail Clients: Evolution, Balsa, and Others . . . . . . . . . . . . .
The K Desktop Mail Client: KMail . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

SquirrelMail Web Mail Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command Line Mail Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Notifications of Received Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing Mail on Remote POP Mail Servers . . . . . . . . . . . . . . . . . . .
Mailing Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Usenet News . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Newsreaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
News Transport Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

307
307
308
309
310
311
312
313
313
313
316
316
317
318
319
320

14

Web, FTP, and Java Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Web Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
URL Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Web Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Your Own Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Java for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
jpackage, Sun, and Java-like (java-gcj-compat) . . . . . . . . . . . . . . . . . .
Installing the Java Runtime Environment: JRE . . . . . . . . . . . . . . . . . .
Enabling the Java Runtime Environment for Mozilla/Firefox . . . . .
The Java Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Java 2 Software Development Kit . . . . . . . . . . . . . . . . . . . . . . . . . .
FTP Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network File Transfer: FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Web Browser–Based FTP: Firefox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The K Desktop File Manager: Konqueror . . . . . . . . . . . . . . . . . . . . . . .
GNOME Desktop FTP: Nautilus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
gFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
wget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
curl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

323
323
324
325
329
329
330
331
331
332

332
332
333
334
334
334
335
335
335
336


Contents

15

Automatic Login and Macros: .netrc . . . . . . . . . . . . . . . . . . . . . . . . . . .
lftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NcFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

339
341
342

Network Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Information: ping, finger, traceroute, and host . . . . . . . . . . . . . . . .
GNOME Network Tools: gnome-nettool . . . . . . . . . . . . . . . . . . . . . . .
ping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
finger and who . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

traceroute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Talk and Messenger Clients: VoIP, ICQ, IRC, AIM, and Talk . . . .
Ekiga . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ICQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Instant Messenger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RSH, Kerberos, and SSH Remote Access Commands . . . . . . . . . . . . . . . . . . .
Remote Access Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Remote Access Permission: .k5login . . . . . . . . . . . . . . . . . . . . . . . . . . .
rlogin, slogin, rcp, scp, rsh, and ssh . . . . . . . . . . . . . . . . . . . . . . . . . . . .

343
343
343
344
345
345
345
346
346
347
347
348
349
350
350
351

Part IV Security
16


Encryption, Integrity Checks, and Signatures: GNU Privacy Guard . . . .
Public Key Encryption, Integrity Checks, and Digital Signatures . . . . . . . .
Public-Key Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Digital Signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Integrity Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Combining Encryption and Signatures . . . . . . . . . . . . . . . . . . . . . . . . .
GNU Privacy Guard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GnuPG Setup: gpg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using GnuPG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Checking Software Package Digital Signatures . . . . . . . . . . . . . . . . . . . . . . . .
Importing Public Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Validating Public Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Checking RPM Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Intrusion Detection: Tripwire and AIDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Encrypted File Systems: luks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

355
355
356
356
356
357
358
358
363
365
365
366
366

367
367

17

Security-Enhanced Linux: SELinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Flask Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SELinux Policy Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Administration Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transition: Labeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

369
370
371
372
372
373
373
374
374
374
374
375


xiii


xiv

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference

18

Multilayer Security (MLS) and Multicategory Security (MCS) . . . . . . . . . . .
Management Operations for SELinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Turning Off SELinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Checking Status and Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Checking Security Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SELinux Management Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuration with system-config-selinux . . . . . . . . . . . . . . . . . . . . . .
SELinux Troubleshooting and audit2allow . . . . . . . . . . . . . . . . . . . . .
semanage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Security Policy Analysis Tool: apol . . . . . . . . . . . . . . . . . . . . . . . .
Checking SELinux Messages: seaudit . . . . . . . . . . . . . . . . . . . . . . . . . .
The SELinux Reference Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Multilayer Security (MLS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Multicategory Security (MCS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Policy Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Type Enforcement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Role-Based Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SELinux Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Policy Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SELinux Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

SELinux Policy Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Contexts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Access Vector Rules: allow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Role Allow Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transition and Vector Rule Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Constraint Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SELinux Policy Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compiling SELinux Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using SELinux Source Configuration . . . . . . . . . . . . . . . . . . . . . . . . . .
InterfaceFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Types Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Module Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security Context Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User Configuration: Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Policy Module Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application Configuration: appconfig . . . . . . . . . . . . . . . . . . . . . . . . .
Creating an SELinux Policy: make and checkpolicy . . . . . . . . . . . . . . . . . . . .
SELinux: Administrative Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Security Contexts: fixfiles, setfiles, restorecon, and chcon . . .
Adding New Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Runtime Security Contexts and Types: Contexts . . . . . . . . . . . . . . . . .

375
375
375
376
376
376
377

380
381
382
382
382
382
383
383
383
383
383
383
384
384
386
386
386
387
387
387
387
388
388
390
390
390
390
390
391
391

391
392
392
392
393

Internet Protocol Security: IPsec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPsec Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPsec Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPsec Security Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPsec Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring IPsec with system-config-network . . . . . . . . . . . . . . . . . . . . . . .
Configuring Connections with setkey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security Associations: SA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

395
396
396
397
397
397
399
399


Contents

Security Policy: SP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Receiving Hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two-Way Transmissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Configuring IPsec with racoon: IKE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connection Configuration with racoon . . . . . . . . . . . . . . . . . . . . . . . .
IPsec and IP Tables: Net Traversal . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPsec Tunnel Mode: Virtual Private Networks . . . . . . . . . . . . . . . . . . . . . . . . .

399
400
400
401
402
403
403
403

19

Secure Shell and Kerberos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Secure Shell: OpenSSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SSH Encryption and Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . .
SSH Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SSH Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SSH Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Port Forwarding (Tunneling) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SSH Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Kerberos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Kerberos Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Authentication Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Kerberized Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Kerberos Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


405
405
406
407
408
411
413
414
414
415
416
417
417

20

Network Firewalls: Netfilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Firewalls: IPtables, NAT, and ip6tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPtables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ip6tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Packet Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Firewall and NAT Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding and Changing Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPtables Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accepting and Denying Packets: DROP and ACCEPT . . . . . . . . . .
User-Defined Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ICMP Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Controlling Port Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Packet States: Connection Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specialized Connection Tracking: ftp, irc, Amanda, tftp . . . . . . . . . .
Network Address Translation (NAT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding NAT Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nat Targets and Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nat Redirection: Transparent Proxies . . . . . . . . . . . . . . . . . . . . . . . . . .
Packet Mangling: the Mangle Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPtables Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Red Hat and Fedora IPtables Support . . . . . . . . . . . . . . . . . . . . . . . . . .
Red Hat and Fedora ip6tables Support . . . . . . . . . . . . . . . . . . . . . . . . .
An IPtables Script Example: IPv4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IP Masquerading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Masquerading Local Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

419
419
420
421
421
421
422
422
423
423
424
424
427
427

428
429
430
431
431
431
433
433
433
434
437
437
445
446

xv


xvi

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference

Masquerading NAT Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IP Forwarding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Masquerading Selected Hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

446
447
447


Part V Red Hat and Fedora Servers
21

22

Managing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Startup Files: /etc/rc.d and /etc/sysconfig . . . . . . . . . . . . . . . . . . . .
rc.sysinit and rc.local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/rc.d/init.d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SysV Init: init.d Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting Services: Stand-Alone and xinetd . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting Services Directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting and Stopping Services with Service Scripts . . . . . . . . . . . . . .
Starting Services Automatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Service Management Tools: chkconfig and system-config-services . . . . . . .
system-config-services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
chkconfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Service Scripts: /etc/init.d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Service Script Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Service Script Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Service Script Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Service Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extended Internet Services Daemon (xinetd) . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting and Stopping xinetd Services: system-config-services
On Demand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xinetd Configuration: xinetd.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xinetd Service Configuration Files: /etc/xinetd.d Directory . . . . . . .
Configuring Services: xinetd Attributes . . . . . . . . . . . . . . . . . . . . . . . .
Disabling and Enabling xinetd Services . . . . . . . . . . . . . . . . . . . . . . . .
TCP Wrappers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


451
451
451
452
453
455
455
456
456
457
457
458
461
461
462
463
465
465

FTP Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FTP Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Available Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora and Red Hat FTP Server Directories . . . . . . . . . . . . . . . . . . . .
FTP Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Anonymous FTP: vsftpd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The FTP User Account: anonymous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FTP Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating New FTP Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Anonymous FTP Server Directories . . . . . . . . . . . . . . . . . . . . . . . . . . .

Anonymous FTP Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using FTP with rsync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing FTP Sites with rsync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring an rsync Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
rsync Mirroring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Very Secure FTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running vsftpd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring vsftpd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

473
473
474
474
475
475
476
476
476
477
477
478
478
478
479
480
480
480

465
466

469
469
470
471


Contents

vsftpd Access Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vsftpd Virtual Hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vsftpd Virtual Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

484
485
486

23

Web Servers: Apache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Alternate Web Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Apache Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Java: Apache Jakarta Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linux Apache Installations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Apache Multiprocessing Modules: MPM . . . . . . . . . . . . . . . . . . . . . . .
Starting and Stopping the Web Server . . . . . . . . . . . . . . . . . . . . . . . . .
Apache Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Apache Configuration and Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Global Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Directory-Level Configuration: .htaccess and <Directory> . . . . . . . .
Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
URL Pathnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MIME Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CGI Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Automatic Directory Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Virtual Hosting on Apache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IP-Based Virtual Hosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Name-Based Virtual Hosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dynamic Virtual Hosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Server-Side Includes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Apache Configuration Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Web Server Security: SSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

487
487
488
489
489
490
490
490
492
493
494
496
497

498
498
499
499
500
500
501
503
503
503
504
506
507
508
508

24

Proxy Servers: Squid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Client Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The squid.conf File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connecting to Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Memory and Disk Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Administrative Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Web Server Acceleration: Reverse Proxy Cache . . . . . . . . . . . . . . . . . . . . . . . .

513

514
516
516
519
519
520
520
520
520

25

Mail Servers: SMTP, POP, and IMAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mail Transport Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Received Mail: MX Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Postfix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Postfix Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Postfix Configuration: main.cf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Postfix Greylisting Policy Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Controlling User and Host Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

523
523
524
525
526
526
528
528


xvii


xviii

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference

26

Sendmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Aliases and LDAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sendmail Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sendmail Masquerading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Mail Servers and Mail Clients . . . . . . . . . . . . . . . . . . . . .
Configuring Sendmail for a Simple Network Configuration . . . . . .
Configuring Sendmail for a Centralized Mail Server . . . . . . . . . . . . .
Configuring a Workstation with Direct ISP Connection . . . . . . . . . . .
The Mailer Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Virtual Domains: virtusertable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
POP and IMAP Server: Dovecot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dovecot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Other POP and IMAP Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Spam: SpamAssassin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

530
532
533
537
539

540
540
541
541
542
542
544
545
546
546

Print, News, and Database Servers: CUPS, INN, and MySQL . . . . . . . . .
Printer Devices and Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Printer Device Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Spool Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting the CUPS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Printers with CUPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Remote Printers on CUPS . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring a Shared CUPS Printer . . . . . . . . . . . . . . . . . . . . . . . . . . .
CUPS Printer Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CUPS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cupsd.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CUPS Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CUPS Command Line Print Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
lpr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
lpc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
lpq and lpstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
lprm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CUPS Command Line Administrative Tools . . . . . . . . . . . . . . . . . . . . . . . . . .
lpadmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lpoptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
enable and disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
accept and reject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
lpinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
News and Search Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
News Servers: INN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Newsreader Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INN Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Database Servers: MySQL and PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . .
Relational Database Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

549
550
550
551
551
551
552
553
553
553
554
554
554
555
555

556
556
556
557
558
558
558
558
558
559
560
560
561
561
562
562
563
566


Contents

Part VI System Administration
27

Basic System Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Superuser Control: the Root User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Root User Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Root User Access: su . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Controlled Administrative Access: sudo . . . . . . . . . . . . . . . . . . . . . . . .

System Time and Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the system-config-date Utility . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the date Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Scheduling Tasks: cron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The crond Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
crontab Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Environment Variables for cron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The cron.d Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The crontab Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing in cron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Organizing Scheduled Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running cron Directory Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Cron Directory Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Anacron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Runlevels: telinit, initab, and shutdown . . . . . . . . . . . . . . . . . . . . . . .
Runlevels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Runlevels in initab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changing Runlevels with telinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The runlevel Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
chkconfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The service Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
system-config-services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora Administration Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Program Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuration Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuration Files: /etc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/sysconfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

System Logs: /var/log and syslogd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
syslogd and syslog.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Entries in syslogd.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Actions and Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
An Example for /etc/syslog.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Linux Auditing System: auditd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Performance Analysis Tools and Processes . . . . . . . . . . . . . . . . . . . . . . . . . . .
GNOME System Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The ps Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vmstat, free, top, iostat, Xload, and sar . . . . . . . . . . . . . . . . . . . . . . . . .
System Tap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Frysk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

569
569
570
570
572
573
573
574
574
574
575
575
576
576
576
576

577
578
578
578
578
580
580
581
581
582
582
583
583
583
584
584
585
585
587
588
589
589
589
591
591
592
593
594
594
595

595
595

xix


xx

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference

28

GNOME Power Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GKrellM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KDE Task Manager and Performance Monitor (KSysguard) . . . . . . .
Grand Unified Bootloader (GRUB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

595
596
597
597

Managing Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Password Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/passwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/shadow and /etc/gshadow . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Password Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing User Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Profile Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

/etc/skel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/login.defs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/login.access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Controlling User Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding and Removing Users with useradd, usermod, and userdel . . . . . .
useradd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
usermod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
userdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/group and /etc/gshadow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User Private Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Group Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing Groups with the system-config-users . . . . . . . . . . . . . . . . .
Managing Groups Using groupadd, groupmod, and groupdel . . . .
Controlling Access to Directories and Files: chmod . . . . . . . . . . . . . . . . . . . .
Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
chmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ownership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changing a File’s Owner or Group: chown and chgrp . . . . . . . . . . . .
Setting Permissions: Permission Symbols . . . . . . . . . . . . . . . . . . . . . .
Absolute Permissions: Binary Masks . . . . . . . . . . . . . . . . . . . . . . . . . .
Directory Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ownership Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sticky Bit Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Permission Defaults: umask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Disk Quotas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Quota Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
edquota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
quotacheck, quotaon, and quotaoff . . . . . . . . . . . . . . . . . . . . . . . . . . . .
repquota and quota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Lightweight Directory Access Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LDAP Clients and Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LDAP Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring the LDAP server: /etc/slapd.conf . . . . . . . . . . . . . . . . . .
LDAP Directory Database: ldif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LDAP Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LDAP and PAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

601
601
601
602
603
603
604
604
604
604
605
605
606
607
608
609
609
609
609
610
610
610

611
611
612
614
614
615
616
617
618
619
619
620
620
621
621
622
622
622
623
623
624
629
629


Contents

29

LDAP and the Name Service Switch Service . . . . . . . . . . . . . . . . . . . .

Pluggable Authentication Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PAM Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PAM Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

629
630
630
630

Software Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Software Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Software Package Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Downloading ISO and DVD Distribution Images with BitTorrent . . . . . . . .
Updating Using yum and PUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Update with the yum Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Automatic Yum Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Fedora Packages with YUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Yum Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/yum.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Repository Files:/etc/yum.repos.d . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fedora . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Livna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Freshrpms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
jpackage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Local Yum Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing YUM Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
APT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Red Hat Package Manager (RPM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RPM Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

RPM Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing from the Desktop: rpm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command Line Installation: rpm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The rpm Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Querying Information from RPM Packages
and Installed Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing and Updating Packages with rpm . . . . . . . . . . . . . . . . . . . .
Installation Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Removing RPM Software Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RPM: Verifying an RPM Installation . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rebuilding the RPM Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Software from RPM Source Code Files: SRPMs . . . . . . . . . . . . . . .
Source Code RPM Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Building the Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Software from Compressed Archives: .tar.gz . . . . . . . . . . . . . . . . .
Decompressing and Extracting Software in One Step . . . . . . . . . . . .
Decompressing Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selecting an Install Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extracting Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compiling Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configure Command Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Development Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Shared and Static Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Makefile File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

633
634
635
635
636

637
637
637
638
638
639
639
640
640
641
641
642
642
642
643
643
644
644
644
644
647
648
649
650
650
651
651
651
651
652

652
652
653
653
654
655
655
656
656

xxi


xxii

Fedora 7 & Red Hat Enterprise Linux: The Complete Reference

30

Command and Program Directories: PATH . . . . . . . . . . . . . . . . . . . . . . . . . . .
/etc/profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.bash_profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Subversion and CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Packaging Your Software with RPM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

657
657
658
658
659


File System Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filesystem Hierarchy Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Root Directory: / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The /usr Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The /media Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The /mnt Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The /home Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The /var Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The /proc File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The sysfs File System: /sys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Device Files: /dev, udev, and HAL . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File System Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Journaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ext3 Journaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReiserFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting File Systems Automatically: /etc/fstab . . . . . . . . . . . . . . . . . . . . .
Hal and fstab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
fstab Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Auto Mounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mount Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Boot and Disk Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
fstab Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Partition Labels: e2label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Windows Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linux Kernel Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
noauto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Mounting File Systems Manually: mount and umount . . . . . . . . . . . . . . . . .
The mount Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The umount Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting Floppy Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting DVD/CD-ROMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mounting Hard Drive Partitions: Linux and Windows . . . . . . . . . . .
Creating File Systems: mkfs, mke2fs, mkswap, parted, and fdisk . . . . . . . .
fdisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
parted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mkfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mkswap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CD-ROM and DVD ROM Manual Recording . . . . . . . . . . . . . . . . . . . . . . . . .
mkisofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
dvdrecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
dvd+rw Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

661
662
662
662
664
665
665
666
666
666
666
666
668
671

671
673
673
674
674
674
675
676
676
677
677
678
679
679
680
680
680
682
682
683
684
684
686
687
687
689
689
689
691
691



Contents

31

RAID and LVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Logical Volume Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LVM Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating LVMs During Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . .
system-config-lvm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LVM Tools: Using the LVM Commands . . . . . . . . . . . . . . . . . . . . . . . .
LVM Example for Multiple Hard Drives . . . . . . . . . . . . . . . . . . . . . . .
Using LVM to Replace Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LVM Example for Partitions on Different Hard Drives . . . . . . . . . . .
Configuring RAID Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hardware RAID Support: dmraid . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linux Software RAID Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RAID Devices and Partitions: md and fd . . . . . . . . . . . . . . . . . . . . . . .
Booting from a RAID Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RAID Administration: mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating and Installing RAID Devices . . . . . . . . . . . . . . . . . . . . . . . . .
Corresponding Hard Disk Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . .
RAID Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

693
694
694
695
695

697
700
703
703
705
705
706
708
708
708
709
715
716

32

Devices and Modules: udev, HAL, and MAKEDEV . . . . . . . . . . . . . . . . . .
Hardware Device Installation: Kudzu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Device Information: /sys, /proc, and /etc/sysconfig/hwconf . . . . . . . . . .
The sysfs File System: /sys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The proc File System: /proc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
udev: Device Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
udev Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Device Names and udev Rules: /etc/udev/rules.d . . . . . . . . . . . . . .
Symbolic Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Program Fields and /lib/udev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating udev Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SYMLINK Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Persistent Names: udevinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Permission Fields: MODE, GROUP, OWNER . . . . . . . . . . . . . . . . . . .

Hardware Abstraction Layer: HAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The HAL Daemon and hal-device-manager (hal-gnome) . . . . . . . . .
HAL Configuration: /etc/hal/fdi, and /usr/share/hal/fdi . . . . . . .
Device Information Files: fdi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Device Information File Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Manual Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Device Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MAKEDEV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mknod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mono and .NET Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing and Managing Terminals and Modems . . . . . . . . . . . . . . . . . . . . . .
Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mingetty, mgetty, and agetty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
termcap and inittab Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
tset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Sound, Network, and Other Cards . . . . . . . . . . . . . . . . . . . . . . . . .

719
720
720
721
721
722
723
724
726
728
728

729
730
731
732
733
733
733
734
735
737
738
738
739
740
740
741
741
741
742
742
742

xxiii


×