Red Hat Linux 6.2 Reference Guide
Red Hat Linux 6.2 Reference Guide
2
The Official Red Hat Linux Reference Guide
ISBN: 1-58569-020-1
Red Hat, Inc.
2600 Meridian Parkway Durham NC 27709 US 919-547-0012 1-888-733-4281 919-547-0024
docs@redhat.com 13588 Research Triangle Park NC 27713
2000 Red Hat, Inc.
RefGuide(EN)-6.2-Print-RHI (02/00)
Red Hat is a registered trademark and the Red Hat Shadow Man logo, RPM, the RPM logo, and Glint
are trademarks of Red Hat, Inc.
Linux is a registered trademark of Linus Torvalds.
Motif and UNIX are registered trademarks of The Open Group.
Alpha is a trademark of Digital Equipment Corporation.
SPARC is a registered trademark of SPARC International, Inc. Products bearing the SPARC trademark
are based on an architecture developed by Sun Microsystems, Inc.
Netscape is a registered trademark of Netscape Communications Corporation in the United States and
other countries.
TrueType is a registered trademark of Apple Computer, Inc.
Windows is a registered trademark of Microsoft Corporation.
All other trademarks and copyrights referred to are the property of their respective owners.
Copyright 2000 by Red Hat, Inc. This material may be distributed only subject to the terms and con-
ditions set forth in the Open Publication License, V0.4 or later (the latest version is presently available
at http://www.opencontent.org/openpub/).
Distribution of substantively modified versions of this document is prohibited without the explicit per-
mission of the copyright holder.
Distribution of the work or derivative of the work in any standard (paper) book form for commercial
purposes is prohibited unless prior permission is obtained from the copyright holder.
Printed in Canada, Ireland, and Japan
ii
Contents
Red Hat Linux 6.2
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Getting the Documentation Thats Right for You. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
More to Come . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Sign Up for Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Part I System-Related Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 1 Red Hat Linux 6.2 New Features . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.1 Installation-related Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.2 System-Related New Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.3 Miscellaneous New Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 2 System Administration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.1 Filesystem Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Special Red Hat File Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.3 Users, Groups and User-Private Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.4 Configuring Console Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.5 The floppy Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.6 User Authentication with PAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.7 Shadow Utilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.8 Building a Custom Kernel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.9 Sendmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.10 Controlling Access to Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.11 Anonymous FTP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.12 NFS Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.13 The Boot Process, Init, and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.14 Rescue Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
iii
Chapter 3 System Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.1 System Configuration with linuxconf. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.2 System Configuration with the Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Chapter 4 PowerTools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.1 PowerTools Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.2 Reading the Contents of the CD-ROM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.3 Installing PowerTools Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Chapter 5 Working with Update Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.1 Starting Update Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.2 Configuring Update Agent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.3 Using Update Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Chapter 6 Package Management with RPM. . . . . . . . . . . . . . . . . . . . . . . . . . 149
6.1 RPM Design Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
6.2 Using RPM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.3 Impressing Your Friends with RPM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.4 Other RPM Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Chapter 7 Gnome-RPM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7.1 Starting Gnome-RPM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7.2 The Package Display. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
7.3 Installing New Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
7.4 Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
7.5 Package Manipulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Chapter 8 Lightweight Directory Access Protocol (LDAP). 183
8.1 What is LDAP?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
8.2 Pros and Cons of LDAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
8.3 Uses for LDAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
8.4 LDAP Terminology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
8.5 OpenLDAP Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
iv
8.6 OpenLDAP Daemons and Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
8.7 Modules for Adding Extra Functionality to LDAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
8.8 LDAP How To: A Quick Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
8.9 Configuring Your System to Authenticate Using OpenLDAP. . . . . . . . . . . . . . . . . 189
8.10 LDAP Resources on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Part II Installation-Related Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Chapter 9 Preparing for a Text Mode Installation . . . . . . . . . . . . . . . . 197
9.1 Things You Should Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Chapter 10 Installing Red Hat Linux via Text Mode. . . . . . . . . . . . . . . 205
10.1 The Installation Program User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
10.2 Starting the Installation Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
10.3 Choosing a Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10.4 Selecting a Keyboard Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10.5 Selecting an Installation Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
10.6 Identify Disk Partition to Install From . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
10.7 Installing over a Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
10.8 Welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
10.9 Upgrading or Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
10.10 Partitioning Your Disk for Red Hat Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
10.11 Installing LILO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
10.12 Naming Your Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
10.13 Configuring a Network Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
10.14 Configuring Your Mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
10.15 Configuring the Time Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
10.16 Setting a Root Password. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
10.17 Creating a User Account. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
10.18 Authentication Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
10.19 Select Packages to Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
10.20 Configuring Your Video Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
10.21 Package Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
10.22 Configuring the X Window System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
v
10.23 Creating a Boot Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
10.24 Finishing Up. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Part III Appendixes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Appendix A General Parameters and Modules. . . . . . . . . . . . . . . . . . . . . . . . 275
A.1 A Note About Kernel Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
A.2 CD-ROM Module Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
A.3 SCSI parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
A.4 Ethernet parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Appendix B An Introduction to Disk Partitions . . . . . . . . . . . . . . . . . . . . . . . 295
B.1 Hard Disk Basic Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Appendix C Driver Disks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
C.1 Why Do I Need a Driver Disk? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Appendix D How to Create a Dual-Boot System . . . . . . . . . . . . . . . . . . . . . 323
D.1 If Your Computer Already Has An Operating System ... . . . . . . . . . . . . . . . . . . . . . . 323
D.2 Setting Up a Dual-Boot Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
D.3 Partitioning with FIPS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Appendix E RAID (Redundant Array of Independent Disks) . 335
E.1 What is RAID? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Appendix F Kickstart Installations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
F.1 What are Kickstart Installations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
F.2 How Do You Perform a Kickstart Installation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
F.3 Starting a Kickstart Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
F.4 The Kickstart File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
F.5 Kickstart Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
vi
Section 0.2:Getting the Documentation Thats Right for You vii
Introduction
Welcome
Welcome to the Official Red Hat Linux Reference Guide.
The Official Red Hat Linux Reference Guide contains useful information about your
Red Hat Linux system. In fact, much of the information youll find within can be
extended to just about any Linux distribution. From fundamental concepts such as
using RPM and Gnome-RPM to the finer points of using disk partitioning, we hope
youll find this book to be a valuable resource.
This guide is for you if you want to learn a bit more about how your Red Hat Linux
system works. Among the featured entries, youll learn about:
Partitioning concepts -- Both an introduction to disk partitions and the strategies
behind "finding a home" for more than one operating system on hard drives.
Text mode installation -- Despite Red Hat Linuxs GUI installation, you may
want the control of a text mode install. Heres what youll find, and what to
expect.
RPM -- From both the Gnome-RPM front-end to using RPM at the console.
RAID concepts -- Take one disk drive, add another, and another Make them
appear as a single logical unit, and youve got power and performance.
Post-installation configuration -- Want to do a little tweaking after the installa-
tion? Heres where you can get a start.
Getting the Documentation Thats Right for You
While the Official Red Hat Linux Reference Guide digs into more of the nuts and bolts
of your Red Hat Linux system, it is critical to make sure you have documentation that
is appropriate to your level of Linux expertise. Regardless of your experience with
Linux, it can be easy to feel overwhelmed without the right documentation.
viii Introduction
Lets take a look at three categories of people using Red Hat Linux, and try to be
more explicit in terms of the documentation youll need. Lets start by figuring out
your experience level. Here are the three basic categories:
New to Linux
Has never used any Linux (or Linux-like) operating system before, or has had
only limited exposure to Linux. May or may not have experience using other
operating systems (such as Windows). Is this you? If so, please turn to Docu-
mentation For First-Time Linux Users.
Some Linux Experience
Has installed and successfully used Linux (but not Red Hat Linux) before. Or,
may have equivalent experience with other Linux-like operating systems. Does
this describe you? If so, please turn to For the More Experienced.
Old-Timer
Has installed and successfully used Red Hat Linux before. Are you an old-
timer? If so, please turn to Documentation for Linux Gurus.
Documentation For First-Time Linux Users
"A journey of a thousand miles begins with a single step." This old saying can be
applied to learning about your Red Hat Linux system. Learning to use a Linux system
effectively can be a long, rewarding journey, in which you find that you can easily do
things about which people with other operating systems can only dream. But like all
journeys, youve got to start somewhere, and take that first step.
First, get yourself some documentation! This cannot be stressed enough; without
documentation you will only become frustrated at your inability to get your Red Hat
Linux system working the way you want.
Heres the sort of Linux documentation you should get your hands on:
A brief history of Linux -- Many aspects of Linux are the way they are because of
historical precedent. There is also a Linux culture that, again, is based to a great
deal on past history. A bit of knowledge about the history of Linux will serve
Section 0.2:Getting the Documentation Thats Right for You ix
you well, particularly as you interact with more experienced Linux users on the
Internet.
An explanation of how Linux works -- While its not necessary to delve into
the most arcane aspects of the Linux kernel, its a good idea to know something
about how Linux is put together. This is particularly important if youve been
working with other operating systems; some of the assumptions you hold about
howcomputers work may not transfer fromthat operating systemto Linux. Afew
paragraphs that discuss howLinux works (and particularly howit differs fromthe
operating system youre used to) can be invaluable in getting off to a good start
with your Red Hat Linux system.
An introductory command overview(with examples) -- This is probably the most
important thing to look for in Linux documentation. The design philosophy be-
hind Linux is that its better to use many small commands connected together in
different ways than it is to have a few large (and complex) commands that do the
whole job themselves. Without some examples that illustrate the Linux approach
to doing things, you will find yourself intimidated by the sheer number of com-
mands available on your Red Hat Linux system.
Here is some additional direction that may help to match all of your requirements:
Books -- Linux for Dummies, by John "maddog" Hall, published by IDG; Using
Linux, by William H. Ball, published by Que; Running Linux, by Matt Welsh and
Lar Kaufman, published by OReilly & Associates; Red Hat Linux Secrets, by
Naba Barkakati, published by IDG.
Red Hats website -- At our very own website (http://www.redhat.com), youll
find links to the Linux Documentation Project (LDP), the Official Red Hat Linux
Installation Guide, the Official Red Hat Linux Getting Started Guide FAQs (Fre-
quently Asked Questions), a database which can help you search for a Linux Users
Group near you, a knowledgebase of information, and more. In short, youll find
a wealth of information to help you get started.
Newsgroups -- Linux users are second to none when it comes to helping new
users understand Linux. You can find dozens of Linux-related newsgroups on the
Usenet, but a quick search through Deja.com (http://www.deja.com) shows:
x Introduction
linux.help
linux.redhat
linux.redhat.digest
linux.redhat.misc
linux.redhat.rpm
Also, from the Deja.com website, you can frequently search for specific informa-
tion from Linux newsgroups.
Continue reading the next section to find out more about the kinds of documentation
that will help you at that point.
For the More Experienced
If youve used other Linux distributions, you probably already have a basic grasp of
the most frequently used commands. You may have installed your own Linux system,
and maybe youve even downloaded and built software you found on the Internet.
What sorts of information will you need?
Task-oriented items -- Many times, you will find that you would like to config-
ure your Red Hat Linux system in a certain way, but youre not sure where to
begin. In this case, its often a big help to see what others in similar circum-
stances have done. This is where the Linux Documentation Project (also known
as the LDP) can come in handy. Each of their HOWTOs document a particular
aspect of Linux, fromlow-level kernel esoterica, to using Linux for amateur radio
station work.
If you selected one of the various HOWTO packages when you installed Red Hat
Linux, youll find the HOWTOs on your system in /usr/doc/HOWTO.
Documentation for Linux Gurus
If youre a long-time Red Hat Linux user, you probably already know that the fol-
lowing pretty much says it all when it comes to documentation:
Use the Force -- Read the source!
Section 0.4:Sign Up for Support xi
There are times when youll just have to sit there and look at the sources to understand
things. Fortunately, because of the freely available nature of Linux, its easy to get
the sources. Now if it were only that easy to understand them
More to Come
The Official Red Hat Linux Reference Guide is part of the Red Hats growing com-
mitment to provide useful and timely support to Red Hat Linux users. Future editions
will feature expanded information on system administration, console tools and other
resources to help you extend the power of your Red Hat Linux system-- and yourself.
Thats also where you come in.
Send in Your Feedback
If youd like to make suggestions about the Official Red Hat Linux Reference Guide,
please mention this guides identifier:
RefGuide(EN)-6.2-Print-RHI (02/00)
You can send mail to:
docs@redhat.com
Sign Up for Support
If you have an official edition of Red Hat Linux 6.2, please remember to sign up for
the benefits youre entitled to as a Red Hat customer.
Youll be entitled to any or all of the following benefits, depending upon the Official
Red Hat Linux product you purchased:
Official Red Hat support -- Get help with your installation questions from Red
Hat, Inc.s support team.
Priority FTP access -- No more late-night visits to congested mirror sites. Own-
ers of Red Hat Linux 6.2 receive free access to priority.redhat.com, Red Hats
preferred customer FTP service, offering high bandwidth connections day and
night.
xii Introduction
Red Hat Update Agent -- Receive e-mail directly fromRed Hat as soon as updated
RPMs are available. Use Update Agent filters to receive notification and quickly
download updated packages about those subjects that interest you. Also receive
-- automatically -- kernel updates, security updates and other packages.
Under the Brim: The Official Red Hat E-Newsletter -- Every month, get the latest
news and product information directly from Red Hat.
To sign up, go to http://www.redhat.com/now. Youll find your Personal Product
ID on a red and white card in your Official Red Hat Linux box.
To read more about technical support for Official Red Hat Linux, refer to the Appen-
dix in the Official Red Hat Linux Installation Guide.
Good luck, and thank you for choosing Red Hat Linux!!
The Red Hat Documentation Team
Part I System-Related Reference
Section 1.2:System-Related New Features 15
1 Red Hat Linux 6.2 New Features
This chapter describes features that are new to Red Hat Linux 6.2.
1.1 Installation-related Enhancements
The Red Hat Linux 6.2 installation program includes a number of new features. For
more information, please refer to the Official Red Hat Linux Installation Guide.
1.2 System-Related New Features
There are many new features to Red Hat Linux 6.2 that are not part of the installation
process. Some new features are tools or applications that you can use, others are new
versions of the kernel or desktop environments. This list will provide a little more
information about what to expect fromRed Hat Linux 6.2 once you are actually using
the OS itself.
Network services split into client, server packages:
The following network services have been split into client and server packages
--
telnet
finger
talk
rsh
rusers
rwall
tftp
For example, on the Intel-compatible platform telnet is now packaged in two
RPMs --
telnet-0.16-5.i386.rpm
16 Chapter 1:Red Hat Linux 6.2 New Features
telnet-server-0.16-5.i386.rpm
sysctl now controls system settings:
In Red Hat Linux 6.2, kernel options such as IPv4 forwarding and enabling and
disabling of the "magic sysrq" keys is done via the sysctl program, as opposed
to being controlled by the contents of files in /etc/sysconfig. The sysctl
settings are stored in /etc/sysctl.conf, and are loaded at each boot by
the command:
sysctl -p /etc/sysctl.conf
Here is a sample /etc/sysctl.conf:
# Disables IPv4 packet forwarding
net.ipv4.ip_forward = 0
# Enables source route verification
# This drops packets that come in over interfaces they shouldnt;
# (for example, a machine on an external net claiming to be one on your
# local network)
net.ipv4.conf.all.rp_filter = 1
# Disables automatic defragmentation
# Automatic defragmentation is needed for masquerading and Linux
# Virtual Server use; it is not needed otherwise.
net.ipv4.ip_always_defrag = 0
# Disables the magic-sysrq key
kernel.sysrq = 0
# Disables stop-a on the sparc
kernel.stop-a = 0
Many other kernel tunable parameters can be set; to see the full list, run
sysctl -a, or look in the file /usr/doc/kernel-doc-<ver-
sion>/sysctl.
Section 1.2:System-Related New Features 17
Please Note
If you are upgrading your Red Hat Linux system
to Red Hat Linux 6.2, any changes you have made
to files in /etc/sysconfig will be migrated to
/etc/sysctl.conf. You should confirm this by
reviewing the file.
Linux 2.2.14 kernel:
Red Hat Linux 6.2 includes the latest stable version of the 2.2.x Linux kernel.
ident service now run as daemon:
The ident service is now run as a stand-alone service (called "identd"), and is
controlled by settings in the /etc/identd.conf file.
Workstation-class installation now more secure:
Workstation-class installations no longer install the inetd "super server." This
means that the following network-related services will not be available if you
perform a workstation-class installation:
ftp
telnet
shell
login
talk
finger
If you require the above network-related services, you should consider an in-
stallation type other than workstation-class.
XFree86 version 3.3.6:
18 Chapter 1:Red Hat Linux 6.2 New Features
Red Hat Linux 6.2 contains the latest version of XFree86 (version 3.3.6 which
supports many new drivers).
Services no longer run by default:
To permit a more fine-tuned systemconfiguration, Red Hat Linux 6.2 no longer
runs the following services by default --
The automount daemon amd (in the am-utils RPM)
The bind name server
The dhcpd DHCP server
The inn news server
The knfsd NFS server
The samba CIFS server used to support Windows-based file and print ser-
vices
To enable these services, either use chkconfig --level 35 <ser-
vice-name> on, or edit the list of services to start with the ntsysv or tksysv
utilities.
Mesa graphics library now included:
The Mesa 3-D graphics library (version 3.2) is now included. Mesa is compat-
ible with the OpenGL graphics API.
Sawmill window manager now included:
The sawmill window manager is now included in Red Hat Linux 6.2. Based on
a Lisp-like language, sawmill is extensible, and GNOME-aware.
Man pages now compressed:
All man pages are now compressed (using gzip) to save disk space.
Starting programs at X startup:
By placing scripts in /etc/X11/xinitrc/xinitrc.d, it is nowpossible
to automatically start programs whenever X starts.
Section 1.3:Miscellaneous New Features 19
Fonts recognized automatically:
X fonts that have been added to your Red Hat Linux 6.2 system will now be
recognized automatically, when the font server starts. This can be done during
an X session by issuing the following command as root:
/etc/rc.d/init.d/xfs restart
Encryption-related changes:
Due to relaxation of U.S. encryption laws, encryption-related changes have
been made to the following packages:
Kerberos authentication has been added to mutt, pine, fetchmail, cvs, and imap.
The GNU Privacy Guard (GnuPG) is now included in all editions of Red
Hat Linux 6.2.
For those platforms that support it, Netscape Communicator built with 128-bit
encryption is included in Red Hat Linux 6.2.
1.3 Miscellaneous New Features
These new features defy categorization:
Packages moved to PowerTools --
The following packages have been moved to PowerTools:
The dosemu DOS emulator
Version 1 of the fvwm window manager
The aKtion and xanim movie viewers
The mxp fractal generator
The xwpick window grabber
The xearth eye candy application
20 Chapter 1:Red Hat Linux 6.2 New Features
Changes to termcap and terminfo entries --
The termcap and terminfo entries have been changed to make the actions of the
following keys more consistent:
[Backspace]
[Delete]
[Home]
[End]
Changes may be made by editing your .inputrc file.
DocBook support --
Red Hat Linux 6.2 includes support for editing and processing SGML docu-
ments written to use the DocBook DTD.
New documentation CD-ROM --
Red Hat Linux 6.2 boxed sets now include a documentation CD-ROM. The
CD-ROM can be used in two ways:
To install RPM-packaged documentation on your Red Hat Linux system.
To read the documentation directly from the CD-ROM. For more informa-
tion, please see the README on the documentation CD-ROM.
Colorized ls command --
The ls command is now colorized by default. To turn off this feature, add
the command unalias ls in your .bashrc file, or (to disable color on a
system-wide basis) delete the colorls.* files in /etc/profile.d/.
Deprecated features and packages --
The following features and packages are deprecated, and may not be supported
or included in future releases of Red Hat Linux:
The AnotherLevel environment
Section 1.3:Miscellaneous New Features 21
The wmconfig dynamic window manager configuration tool
The svgalib graphics library
The Red Hat Linux version 5.2 compatibility development environment
The mars-nwe NetWare server emulator
The BSD lpr printing system
The libc5 compatibility runtime libraries
Version 1.x of the Qt library
The libjpeg6a Red Hat Linux 5.x compatibility library
The iBCS program compatibility technology
22 Chapter 1:Red Hat Linux 6.2 New Features
Section 2.1:Filesystem Structure 23
2 System Administration
This chapter provides an overview of the Red Hat Linux system. Here, you will
learn aspects that you may not know about the system and things that are somewhat
different from other UNIX systems.
2.1 Filesystem Structure
Red Hat is committed to the Filesystem Hierarchy Standard (FHS), a collaborative
document that defines the names and locations of many files and directories. We will
continue to track the standard to keep Red Hat Linux compliant.
The current FHS document is the authoritative reference to any FHS compliant
filesystem, but the standard leaves many areas undefined or extensible. In this
section we provide an overview of the standard and a description of the parts of the
filesystem not covered by the standard.
The complete standard can be viewed at:
http://www.pathname.com/fhs/
While compliance with the standard means many things, the two most important are
compatibility with other compliant systems, and the ability to mount the /usr par-
tition as read-only because it contains common executables and is not meant to be
changed by users. Because of this, /usr can be mounted from the CD-ROM or
from another machine via read-only NFS.
2.1.1 Overview of the FHS
The directories and files noted here are a small subset of those specified by the FHS
document. Check the latest FHS document for the most complete information.
The /dev Directory
The /dev directory contains filesystem entries which represent devices that are at-
tached to the system. These files are essential for the system to function properly.
24 Chapter 2:System Administration
The /etc Directory
The /etc directory is reserved for configuration files that are local to your machine.
No binaries are to be put in /etc. Binaries that were in the past put in /etc should
now go into /sbin or possibly /bin.
The X11 and skel directories should be subdirectories of /etc:
/etc
|- X11
+- skel
The X11 directory is for X11 configuration files such as XF86Config. The skel
directory is for "skeleton" user files, which are files used to populate a home directory
when a user is first created.
The /lib Directory
The /lib directory should contain only those libraries that are needed to execute the
binaries in /bin and /sbin.
The /proc Directory
The /proc directory contains special files that either extract information or send
information to the kernel. It is an easy method of accessing information about the
operating system using the cat command.
The /sbin Directory
The /sbin directory is for executables used only by the root user, and only those ex-
ecutables needed to boot and mount /usr and perform system recovery operations.
The FHS says:
"/sbin typically contains files essential for booting the systemin addition to the binaries
in /bin. Anything executed after /usr is known to be mounted (when there are no
problems) should be placed in /usr/sbin. Local-only system administration binaries
should be placed into /usr/local/sbin."
At a minimum, the following programs should be in /sbin:
arp, clock, getty, halt, init, fdisk,
fsck.*, ifconfig, lilo, mkfs.*, mkswap, reboot,
Section 2.1:Filesystem Structure 25
route, shutdown, swapoff, swapon, update
The /usr Directory
The /usr directory is for files that can be shared across a whole site. The /usr
directory usually has its own partition, and it should be mountable read-only. The
following directories should be subdirectories of /usr:
/usr
|- X11R6
|- bin
|- dict
|- doc
|- etc
|- games
|- include
|- info
|- lib
|- libexec
|- local
|- man
|- sbin
|- share
+- src
The X11R6 directory is for the X Window System (XFree86 on Red Hat Linux), bin
is for executables, doc is for random, non-man-page documentation, etc is for site-
wide configuration files, include is for C header files, info is for GNU info files,
lib is for libraries, man is for man pages, sbinis for systemadministration binaries
(those that do not belong in /sbin), and src is for source code.
The /usr/local Directory
The FHS says:
"The /usr/local hierarchy is for use by the systemadministrator when installing soft-
ware locally. It needs to be safe from being overwritten when the system software is
updated. It may be used for programs and data that are shareable amongst a group of
machines, but not found in /usr."
26 Chapter 2:System Administration
The /usr/local directory is similar in structure to the /usr directory. It has the
following subdirectories, which are similar in purpose to those in the /usr directory:
/usr/local
|- bin
|- doc
|- etc
|- games
|- info
|- lib
|- man
|- sbin
+- src
The /var Directory
Since the FHS requires that you be able to mount /usr read-only, any programs that
write log files or need spool or lock directories probably should write them to the
/var directory. The FHS states /var is for:
"variable data files. This includes spool directories and files, administrative and log-
ging data, and transient and temporary files."
The following directories should be subdirectories of /var:
/var
|- catman
|- lib
|- local
|- lock
|- log
|- named
|- nis
|- preserve
|- run
+- spool
|- anacron
|- at
|- cron
|- fax
|- lpd
|- mail
|- mqueue
+- news
Section 2.2:Special Red Hat File Locations 27
|- rwho
|- samba
|- slrnpull
|- squid
|- up2date
|- uucp
|- uucppublic
|- vbox
|- voice
|- tmp
System log files such as wtmp and lastlog go in /var/log. The /var/lib
directory also contains the RPM system databases. Formatted man pages go in
/var/catman, and lock files go in /var/lock. The /var/spool directory
has subdirectories for various systems that need to store data files.
2.1.2 /usr/local in Red Hat Linux
In Red Hat Linux, the intended use for /usr/local is slightly different from that
specified by the FHS. The FHS says that /usr/local should be where you store
software that is to remain safe fromsystemsoftware upgrades. Since systemupgrades
from Red Hat are done safely with the RPM system and Gnome-RPM, you dont need
to protect files by putting them in /usr/local. Instead, we recommend you use
/usr/local for software that is local to your machine.
For instance, lets say you have mounted /usr via read-only NFS from beavis. If
there is a package or program you would like to install, but you are not allowed to
write to beavis, you should install it under /usr/local. Later perhaps, if youve
managed to convince the system administrator of beavis to install the program on
/usr, you can uninstall it from /usr/local.
2.2 Special Red Hat File Locations
In addition to the files pertaining to the RPM system that reside in /var/lib/rpm
(see Chapter 6, Package Management with RPM for more information on RPM), there
are two other special locations that are reserved for Red Hat Linux configuration and
operation.
28 Chapter 2:System Administration
The control-panel and related tools puts many scripts, bitmaps and text files in
/usr/lib/rhs. There is probably nothing here that you would want to edit.
The other location, /etc/sysconfig, stores configuration information. The ma-
jor users of the files in this directory are the scripts that run at boot time. It is possible
to edit these by hand, but it would be better to use the proper control-panel tool.
2.3 Users, Groups and User-Private Groups
Managing users and groups has traditionally been tedious, but Red Hat Linux has a
few tools and conventions that make users and groups easier to manage.
While you can use useradd to create a new user from the shell prompt, the easiest
way to manage users and groups is through Linuxconf (see Chapter 3, System Config-
uration).
Next, well discuss the basic structure behind managing users and groups.
2.3.1 Standard Users
In Table 21, Standard Users, youll find the standard users set up by the installation
process (this is essentially the /etc/passwd file). The Group ID (GID) in this
table is the primary group for the user. See Section 2.3.3, User Private Groups for
details on how groups are used.
Table 21 Standard Users
User UID GID Home Directory Shell
root 0 0 /root /bin/bash
bin 1 1 /bin
daemon 2 2 /sbin
adm 3 4 /var/adm
lp 4 7 /var/spool/lpd
sync 5 0 /sbin /bin/sync
shutdown 6 0 /sbin /sbin/shutdown
Section 2.3:Users, Groups and User-Private Groups 29
User UID GID Home Directory Shell
halt 7 0 /sbin /sbin/halt
mail 8 12 /var/spool/mail
news 9 13 /var/spool/news
uucp 10 14 /var/spool/uucp
operator 11 0 /root
games 12 100 /usr/games
gopher 13 30 /usr/lib/go-
pher-data
ftp 14 50 /home/ftp
nobody 99 99 /
2.3.2 Standard Groups
In Table 22, Standard Groups, youll find the standard groups as set up by the in-
stallation process (this is essentially the /etc/group file).
Table 22 Standard Groups
Group GID Members
root 0 root
bin 1 root, bin, daemon
daemon 2 root, bin, daemon
sys 3 root, bin, adm
adm 4 root, adm, daemon
tty 5
disk 6 root
lp 7 daemon, lp
30 Chapter 2:System Administration
Group GID Members
mem 8
kmem 9
wheel 10 root
mail 12 mail
news 13 news
uucp 14 uucp
man 15
games 20
gopher 30
dip 40
ftp 50
nobody 99
users 100
floppy 19
2.3.3 User Private Groups
Red Hat Linux uses a user private group (UPG) scheme, which makes UNIXgroups
much easier to use. The UPGscheme does not add or change anything in the standard
UNIXway of handling groups. It simply offers a newconvention for handling groups.
Whenever you create a newuser, by default, he or she has a unique group. The scheme
works as follows:
User Private Group
Each user has their own primary group, of which only they are a member.
umask = 002
Section 2.3:Users, Groups and User-Private Groups 31
The traditional UNIXumask is 022, which prevents other users and other mem-
bers of a users primary group from modifying a users files. Since every user
has their own private group in the UPG scheme, this "group protection" is not
needed. Aumask of 002 will prevent users frommodifying other users private
files. The umask is set in /etc/profile.
setgid bit on Directories
If you set the setgid bit on a directory (with chmod g+s directory), files
created in that directory will have their group set to the directorys group.
Most IT organizations like to create a group for each major project and assign peo-
ple to the groups they should be in. Managing files traditionally has been difficult,
though, because when someone creates a file it is owned by the primary group he or
she belongs to. When a single person works on multiple projects, it becomes hard to
associate the right files to the right ownership group. In the UPG scheme, groups are
automatically assigned to files on a project-by-project basis, which makes managing
group projects very simple.
Lets say you have a big project called devel, with many people editing the devel files
in a devel directory. Make a group called devel, chgrp the devel directory to
devel, and add the all the devel users to the devel group. Now, all devel users
will be able to edit the devel files and create new files in the devel directory, and
these files will always retain their devel group. Thus, they will always be edit-able
by other devel users.
If you have multiple projects like devel, and users who are working on multiple
projects, these users will never have to change their umask or group when they move
from project to project. The setgid bit on each projects main directory "selects" the
proper group.
Since each users home directory is owned by the user and their private group, it is
safe to set the setgid bit on the home directory. However, by default, files are created
with the primary group of the user, so the setgid bit would be redundant.
User Private Group Rationale
Although UPG is not new to Red Hat Linux 6.2, many people still have questions
about it, such as why UPGis necessary. The following is the rationale for the scheme.
32 Chapter 2:System Administration
Youd like to have a group of people work on a set of files in say, the
/usr/lib/emacs/site-lisp directory. You trust a few people to mess
around in there, but certainly not everyone.
So you enter:
chown -R root.emacs /usr/lib/emacs/site-lisp
and you add the proper users to the group.
To allow the users to actually create files in the directory you enter:
chmod 775 /usr/lib/emacs/site-lisp
But when a user creates a new file it is assigned the group of the users default
group (usually users). To prevent this you enter:
chmod 2775 /usr/lib/emacs/site-lisp
which causes everything in the directory to be created with the "emacs" group.
But the new file needs to be mode 664 for another user in the emacs group to be
able to edit it. To do this you make the default umask 002.
Well, this all works fine, except that if your default group is "users," every file you
create in your home directory will be writable by everybody in "users" (usually
everyone).
To fix this, you make each user have a "private group" as their default group.
At this point, by making the default umask 002 and giving everyone a private default
group, you can easily set up groups that users can take advantage of without doing
any magic. Just create the group, add the users, and do the above chown and chmod
on the groups directories.
2.4 Configuring Console Access
When normal (non-root) users log in to a computer locally, they are given two types
of special permission: they can run certain programs that they would not otherwise
Section 2.4:Configuring Console Access 33
be able to run, and they can access certain files (normally special device files used
to access diskettes, CD-ROMS, and so on) that they would not otherwise be able to
access.
Since there are multiple consoles on a single computer, and multiple users can be
logged into the computer locally at the same time, one of the users has to "win" the
fight to access the files. The first user to log in at the console owns those files. Once
the first user logs out, the next user who logs in will own the files.
In contrast, every user who logs in at the console will be allowed to run programs
normally restricted to the root user. By default, those programs will ask for the users
password. This will be done graphically if X is running which makes it possible to
include these actions as menu items in a graphical user interface. As shipped, the
console-accessible programs are shutdown, halt, and reboot.
2.4.1 Disabling Console Program Access
In environments where the console is otherwise secured (BIOS and LILO passwords
are set, [Ctrl]-[Alt]-[Delete] is disabled, the power and reset switches are disabled, etc.), it
may not be desirable to allowarbitrary users at the console to run shutdown, halt,
and reboot.
In order to disable all access by console users to console programs, you should run
the command:
rm -f /etc/security/console.apps/*
2.4.2 Disabling All Console Access
In order to disable all console access, including program and file access, in the
/etc/pam.d/ directory, comment out all lines that refer to pam_console.so.
The following script will do the trick:
cd /etc/pam.d
for i in * ; do
sed /[^#].*pam_console.so/s/^/#/ < $i > foo && mv foo $i
done
34 Chapter 2:System Administration
2.4.3 Defining the Console
The /etc/security/console.perms file defines the console group. The syn-
tax of that file is very flexible; you can edit the file so that these instructions no longer
apply. However, the default file has a line that looks like this:
<console>=tty[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
When users log in, they are attached to some sort of named terminal, either an X
server with a name like :0 or mymachine.example.com:1.0; or a device like
/dev/ttyS0 or /dev/pts/2. The default is to define that local virtual consoles
and local Xservers are considered local, but if you want to consider the serial terminal
next to you on port /dev/ttyS1 to also be local, you can change that line to read:
<console>=tty[0-9][0-9]* :[0-9]\.[0-9] :[0-9] /dev/ttyS1
2.4.4 Making Files Console-Accessible
In /etc/security/console.perms, there is a section with lines like:
<floppy>=/dev/fd[0-1]*
<cdrom>=/dev/cdrom
<jaz>=/dev/zip
You can also add your own lines:
<scanner>=/dev/sga
(Of course, make sure that /dev/sga is really your scanner and not, say, your hard
drive.)
Thats the first part. The second part is to define what is done with those files. Look
in the last section of /etc/security/console.perms for lines similar to:
<console> 0660 <floppy> 0660 root.floppy
<console> 0600 <cdrom> 0600 root.disk
<console> 0600 <jaz> 0660 root.disk
and add a line like:
Section 2.4:Configuring Console Access 35
<console> 0600 <scanner> 0600 root
Then, when you log in at the console, you will be given ownership of the /dev/sga
device and the permissions will be 0600 (readable and writable by you only). When
you log out, the device will be owned by root and still have 0600 (now: readable and
writable by root only) permissions.
2.4.5 Enabling Console Access for Other Applications
If you wish to make other applications besides shutdown, reboot, and halt
accessible to console users, you will have to do just a little bit more work.
First of all, console access only works for applications which reside in /sbin or
/usr/sbin, so the application that you wish to run must be there.
Create a link from the name of your application to the /usr/bin/console-
helper application:
cd /usr/bin
ln -s consolehelper foo
Create the file /etc/security/console.apps/foo:
touch /etc/security/console.apps/foo
Create a PAM configuration file for the foo service in /etc/pam.d/. We suggest
that you start with a copy of the shutdown service, then change it if you want to
change the behavior:
cp /etc/pam.d/shutdown /etc/pam.d/foo
Now, when you run /usr/bin/foo, it will call consolehelper, which, with
the help of /usr/sbin/userhelper will authenticate the user (asking for the
users password if /etc/pam.d/foo is a copy of /etc/pam.d/shutdown;
otherwise, it will do precisely what is specified in /etc/pam.d/foo) and then run
/usr/sbin/foo with root permissions.
36 Chapter 2:System Administration
2.5 The floppy Group
If, for whatever reason, console access is not appropriate for you, and you need to
give non-root users access to your systems diskette drive, this can be done using the
floppy group. Simply add the user(s) to the floppy group using the tool of your
choice. Heres an example showing how gpasswd can be used to add user fred to
the floppy group:
[root@bigdog root]# gpasswd -a fred floppy
Adding user fred to group floppy
[root@bigdog root]#
User fred will now be able to access the systems diskette drive.
2.6 User Authentication with PAM
Programs which give users access to privileges of any sort need to be able to authen-
ticate the users. When you log into a system, you provide your name and password,
and the login process uses those to authenticate the login -- to verify that you are who
you say you are. Forms of authentication other than passwords are possible, and it is
possible for the passwords to be stored in different ways.
PAM, which stands for Pluggable Authentication Modules, is a way of allowing
the system administrator to set authentication policy without having to recompile
authentication programs. With PAM, you control how the modules are plugged into
the programs by editing a configuration file.
Most Red Hat Linux users will never need to touch this configuration file. When you
use RPM to install programs that require authentication, they automatically make
the changes that are needed to do normal password authentication. However, you
may want to customize your configuration, in which case you must understand the
configuration file.
2.6.1 PAM Modules
There are four types of modules defined by the PAM standard.
Section 2.6:User Authentication with PAM 37
auth modules provide the actual authentication, perhaps asking for and check-
ing a password, and they set "credentials" such as group membership or kerberos
"tickets."
account modules check to make sure that the authentication is allowed (the
account has not expired, the user is allowed to log in at this time of day, and so
on).
password modules are used to set passwords.
session modules are used once a user has been authenticated to allow them
to use their account, perhaps mounting the users home directory or making their
mailbox available.
These modules may be stacked, so that multiple modules are used. For instance,
rlogin normally makes use of at least two authentication methods: if rhosts au-
thentication succeeds, it is sufficient to allow the connection; if it fails, then standard
password authentication is done.
New modules can be added at any time, and PAM-aware applications can then be
made to use them. For instance, if you have a one-time-password calculator system,
and you can write a module to support it (documentation on writing modules is in-
cluded with the system in /usr/doc/pam*), PAM-aware programs can use the
new module and work with the new one-time-password calculators without being re-
compiled or otherwise modified in any way.
2.6.2 Services
Each program using PAM defines its own "service" name. The login program defines
the service type login, ftpd defines the service type ftp, and so on. In general, the
service type is the name of the program used to access the service, not (if there is a
difference) the program used to provide the service.
2.6.3 The Configuration Files
The directory /etc/pam.d is used to configure all PAM applications. (This used
to be /etc/pam.conf in earlier PAM versions; while the pam.conf file is still
38 Chapter 2:System Administration
read if no /etc/pam.d/ entry is found, its use is deprecated.) Each application
(really, each service) has its own file. A file looks like this:
#%PAM-1.0
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_pwdb.so shadow nullok
auth required /lib/security/pam_nologin.so
account required /lib/security/pam_pwdb.so
password required /lib/security/pam_cracklib.so
password required /lib/security/pam_pwdb.so shadow nullok use_authtok
session required /lib/security/pam_pwdb.so
The first line is a comment. (Any line that starts with a # character is a comment.)
Lines two through four stack up three modules to use for login authorization. Line
two makes sure that if the user is trying to log in as root, the tty on which they are
logging in is listed in the /etc/securetty file if that file exists. Line three causes
the user to be asked for a password and the password checked. Line four checks to
see if the file /etc/nologin exists, and if it does, displays the contents of the file,
and if the user is not root, does not let him or her log in.
Note that all three modules are checked, even if the first module fails. This is a security
decision -- it is designed to prevent the user from knowing why their authentication
was disallowed, because knowing why it was disallowed might allow them to break
the authentication more easily. You can change this behavior by changing required
to requisite; if any requisite module returns failure, PAM fails immediately without
calling any other modules.
The fifth line causes any necessary accounting to be done. For example, if shadow
passwords have been enabled, the pam_pwdb.so module will check to see if the
account has expired, or if the user has not changed his or her password and the grace
period for changing the password has expired.
The sixth line subjects a newly changed password to a series of tests to ensure that it
cannot, for example, be easily determinging aed passwordgrknginko3(gmif)5236(chansty)]TJ-2740 -1.1041 TD[(the)-284(us)-2his)-291(passw)10(ole,)-965(it)-28sithldhe uas thepam_pwdb.so
Section 2.6:User Authentication with PAM 39
so only if an auth module has determined that the password needs to be changed ---
for example, if a shadow password has expired.)
The eighth and final line specifies that the pam_pwdb.so module should be used to
manage the session. Currently, that module doesnt do anything; it could be replaced
(or supplemented by stacking) by any necessary module.
Note that the order of the lines within each file matters. While it doesnt really matter
much in which order required modules are called, there are other control flags avail-
able. While optional is rarely used, and never used by default on a Red Hat Linux
system, sufficient and requisite cause order to become important.
Lets look at the auth configuration for rlogin:
auth required /lib/security/pam_securetty.so
auth sufficient /lib/security/pam_rhosts_auth.so
auth required /lib/security/pam_pwdb.so shadow nullok
auth required /lib/security/pam_nologin.so
That looks almost like the login entry, but theres an extra line specifying an extra
module, and the modules are specified in a different order.
First, pam_securetty.so keeps root logins from happening on insecure termi-
nals. This effectively disallows all root rlogin attempts. If you wish to allow them
(in which case we recommend that you not be Internet-connected or be behind a good
firewall), you can simply remove that line.
Second, if pam_rhosts_auth.so authenticates the user, PAM imme-
diately returns success to rlogin without any password checking. If
pam_rhosts_auth.so fails to authenticate the user, that failed authenti-
cation is ignored.
Third, if pam_rhosts_auth.so has failed to authenticate the user, the
pam_pwdb.so module performs normal password authentication.
Finally pam_nologin.so checks /etc/nologin, as specified above.
Note that if you do not want to prompt for a password if the securetty check fails, you
can change the pam_securetty.so module from required to requisite.
40 Chapter 2:System Administration
2.6.4 Shadow Passwords
The pam_pwdb.so module will automatically detect that you are using shadow
passwords and make all necessary adjustments. Please refer to Section 2.7, Shadow
Utilities for more information.
2.6.5 Rexec and PAM
For security reasons, rexec is not enabled in Red Hat Linux 6.2. Should you wish to
enable it, you will need to comment out one line in the file /etc/pam.d/rexec.
Here is a sample of the file (note that your file may differ slightly):
#%PAM-1.0
auth required /lib/security/pam_pwdb.so shadow nullok
auth required /lib/security/pam_nologin.so
account required /lib/security/pam_pwdb.so
To enable rexec, the line referring to the pam_nologin.so module must be com-
mented out:
#%PAM-1.0
auth required /lib/security/pam_pwdb.so shadow nullok
#auth required /lib/security/pam_nologin.so
account required /lib/security/pam_pwdb.so
After this file is modified, rexec will be enabled.
Please Note
If your /etc/pam.d/rexec file contains a line referring
to the pam_securetty.so module, you will not be able
to rexec as root. To do so, you must also comment out the
line referring to the pam_securetty.so module.
More Information
This is just an introduction to PAM. More information is included in the
/usr/doc/pam* directory, including a System Administrators Guide, a Module
Section 2.7:Shadow Utilities 41
Writers Manual, an Application Developers Manual, and the PAM standard,
DCE-RFC 86.0.
2.7 Shadow Utilities
Shadow passwords are a method of improving system security by moving the en-
crypted passwords (normally found in /etc/passwd) to /etc/shadow which is
readable only by root. During the installation of Red Hat Linux, you were given the
option of setting up shadow password protection on your system.
The shadow-utils package contains a number of utilities that support:
Conversion from normal to shadowed passwords and back (pwconv, pwun-
conv)
Verification of the password, group, and associated shadowfiles (pwck, grpck)
Industry-standard methods of adding, deleting and modifying user accounts
(useradd, usermod, and userdel)
Industry-standard methods of adding, deleting, and modifying user groups
(groupadd, groupmod, and groupdel)
Industry-standard method of administering the /etc/group file (gpasswd)
42 Chapter 2:System Administration
Please Note
There are some additional points of interest concerning
these utilities:
The utilities will work properly whether shadowing is
enabled or not.
The utilities have been slightly modified to support Red
Hats user private group scheme. For a description of the
modifications, please see the useradd man page. For
more information on user private groups, please turn to
Section 2.3.3, User Private Groups.
The adduser script has been replaced with a symlink
to /usr/sbin/useradd.
2.8 Building a Custom Kernel
Many people new to Linux often ask, "why should I build my own kernel?" Given
the advances that have been made in the use of kernel modules, the most accurate
response to that question is, "unless you knowwhy you need to build your own kernel,
you probably dont." So unless you have a specific reason to build a customized kernel
(or youre just the curious sort), you may skip ahead to Section 2.9, Sendmail.
In the past, you would need to recompile the kernel if you added new hardware on
your system. The kernel was, in other words, static. Improvements in the Linux 2.0.x
kernels allowed for much of the drivers for hardware to be modularized into compo-
nents that could only be inserted on demand. However, there were major problems
with having multiple kernels on your system that had been compiled for different
advancements (a good case being SMP versus UP kernels). Further advancements
with the modularization of the Linux 2.2.x kernel have allowed for multiple kernels
to more easily co-exist (though not share modules).
Section 2.8:Building a Custom Kernel 43
For information on handling kernel modules see Section 3.2.2, Loading Kernel Mod-
ules. Most of the changes are hidden except when recompiling a customized kernel
for your system.
2.8.1 Building a modularized kernel
These instructions enable you to take advantage of the power and flexibility available
through kernel modularization. If you do not wish to take advantage of modular-
ization, please see Section 2.8.3, Building a monolithic kernel for an explanation of
the different aspects of building and installing a monolithic kernel. Its assumed that
youve already installed the kernel-headers and kernel-source packages
and that you issue all commands from the /usr/src/linux directory.
The most important step is to make sure that you have a working emergency boot
disk in case you make a mistake below. If you didnt make a boot disk during the
installation, use the mkbootdisk command to make one. The standard command
is similar to mkbootdisk --device /dev/fd0 2.2.x. Once done, test the
boot disk to make sure that it will boot the system.
It is important to begin a kernel build with the source tree in a known condition.
Therefore, it is recommended that you begin with the command make mrproper.
This will remove any configuration files along with the remains of any previous builds
that may be scattered around the source tree. Now you must create a configuration
file that will determine which components to include in your new kernel. Available
methods for kernel configuration are listed below:
make config -- An interactive text program. Components are presented and
you answer with Y (yes), N (no), or M (module).
make menuconfig -- A graphical, menu driven program. Components are
presented in a menu of categories, you select the desired components in the same
manner used in the Red Hat Linux installation program. Toggle the tag corre-
sponding to the item you want included; Y (yes), N (no), or M (module).
make xconfig -- An X Window System program. Components are listed in
different levels of menus, and are selected using a mouse. Again, select Y (yes),
N (no), or M (module).
44 Chapter 2:System Administration
make oldconfig -- This is a non-interactive script that will set up your Make-
file to be the default settings. If youre using the Red Hat patched kernel, it will
set up the configuration to be that of the kernel that is shipped for your box. This
is useful in setting up your kernel to known working defaults and then turning off
features that you dont want.
Please Note
In order to use kmod (see Section 3.2.2, Loading Kernel
Modules for details) and kernel modules you must an-
swer Yes to kmod support and module version
(CONFIG_MODVERSIONS) support in the configu-
ration.
If you wish to build a kernel with a configuration file (/usr/src/linux/.con-
fig -- this file is created once one of the above methods has been performed) that
you have already created with one of the above methods, you can omit the make
mrproper and make config commands and use the command make dep fol-
lowed by make clean to prepare the source tree for the build.
The next step in making a modularized kernel is to simply edit
/usr/src/linux/Makefile and compile the source code components into a
working program that your machine can use to boot. The method described here is
the easiest to recover from in the event of a mishap. If you are interested in other
possibilities, details can be found in the Kernel-HOWTO or in the Makefile in
/usr/src/linux on your Linux system.
Edit the Makefile and change the line: EXTRAVERSION = to match a
"unique" name (such as adding your initials to the end of the string, as in
EXTRAVERSION = -2.5.0sjs). This will allow you to have the old
working kernel and the new kernel on your system at the same time.
Build the kernel with make bzImage.
Build any modules you configured with make modules.
Section 2.8:Building a Custom Kernel 45
Install the new modules (even if you didnt build any) with make mod-
ules_install. This will install the kernel modules into the filepath
/lib/modules/ using the path name that was specified in the Makefile.
Our example would be /lib/modules/2.2.15-2.5.0sjs/.
If you have a SCSI adapter and made your SCSI driver modular, build a newinitrd
image (see Section 2.8.2, Making an initrd image; note that there are few practical
reasons to make the SCSI driver modular in a custom kernel). Unless you have a
specific reason to create an initrd image, do not create one and do not add it to
lilo.conf.
In order to provide a redundant boot source to protect from a possible error in a new
kernel you should keep the original kernel available. Adding a kernel to the LILO
menu is as simple as renaming the original kernel in /boot, copying the new kernel
to /boot, adding a few lines in /etc/lilo.conf and running /sbin/lilo.
Here is an example of the default /etc/lilo.conf file shipped with Red Hat
Linux:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=linux
linear
image=/boot/vmlinuz-2.2.15-2.5.0
label=linux
initrd=/boot/initrd-2.2.15-2.5.0.img
read-only
root=/dev/hda8
other=/dev/hda1
label=dos
Now you must update /etc/lilo.conf. If you built a new initrd image you
must tell LILO to use it. In this example of /etc/lilo.conf we have added
four lines in the middle of the file to indicate another kernel to boot from. We have
46 Chapter 2:System Administration
renamed /boot/vmlinuz to /boot/vmlinuz.old and changed its label to
old. We have also added an initrd line for the new kernel:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=linux
linear
image=/boot/vmlinuz-2.2.15-2.5.0
label=linux
initrd=/boot/initrd-2.2.15-2.5.0.img
read-only
root=/dev/hda8
image=/boot/vmlinuz-2.2.15-2.5.0sjs
label=test
initrd=/boot/initrd-2.2.15-2.5.0sjs.img
read-only
root=/dev/hda8
other=/dev/hda1
label=dos
Nowwhen the systemboots and you press [Tab] at the LILOboot: prompt, available
choices will be shown;
LILO boot:
linux test dos
To boot the old kernel (linux) simply press [Enter], or wait for LILO to time out. If
you want to boot the new kernel (test), type test and press [Enter].
Here is a summary of the steps:
Copy the resulting compiled kernel into your /boot directory using the name
that resulted from your earlier changes to the Makefile. Here is an example:
cp -p
/usr/src/linux/arch/i386/boot/bzImage
Section 2.8:Building a Custom Kernel 47
/boot/vmlinuz-2.2.15-2.5.0sjs
Edit /etc/lilo.conf.
Make a new initial ramdisk, initrd image (see Section 2.8.2, Making an initrd
image) if needed.
Run /sbin/lilo. You can add a -v flag to lilo to get more verbose report-
ing if you think there might be a problem.
You can begin testing your new kernel by rebooting your computer and watching the
messages to ensure your hardware is detected properly.
2.8.2 Making an initrd image
An initrd image is needed for loading your SCSI module at boot time. If you do
not need an initrd image, do not make one and do not edit lilo.conf to include
this image.
The shell script /sbin/mkinitrd can build a proper initrd image for your
machine if the following conditions are met:
The loopback block device is available.
The /etc/conf.modules file has a line for your SCSI adapter; for example:
alias scsi_hostadapter BusLogic
To build the new initrd image, run /sbin/mkinitrd with parameters such as
this:
/sbin/mkinitrd /boot/newinitrd-image 2.2.15
Where /boot/newinitrd-image is the file to use for your new image, and
2.2.15 is the kernel whose modules (from /lib/modules) should be used in
the initrd image (not necessarily the same as the version number of the currently
running kernel).
48 Chapter 2:System Administration
2.8.3 Building a monolithic kernel
To build a monolithic kernel you follow the same steps as building a modularized
kernel with a few exceptions.
When configuring the kernel only answer Yes and No to the questions (dont
make anything modular). Also, you should answer No to kmod support and
module version (CONFIG_MODVERSIONS) support in the configu-
ration.
Omit the steps:
make modules
make modules_install
Edit lilo.conf and add the line append=nomodules.
2.9 Sendmail
A default sendmail.cf file will be installed in /etc. The default configuration
should work for most SMTP-only sites (Simple Mail Transfer Protocol) . It will not
work for UUCP (Unix to UNIX Copy Protocol) sites; you will need to generate a
new sendmail.cf if you must use UUCP mail transfers.
Please Note
Although SMTP servers are supported automatically,
IMAP (Internet Message Access Protocol) servers are not.
If your ISP uses an IMAP server rather than an SMTP
sever, you must install the IMAP package. Without it, your
system wont know how to pass information to the IMAP
server or retrieve your mail.
To generate a new sendmail.cf, you will need to install m4 and the sendmail
source package. Read the README file in the sendmail sources for more details on
Section 2.9:Sendmail 49
creating sendmail configuration files. Also, OReilly & Associates publishes a good
sendmail reference entitled sendmail, by Bryan Costales.
One common sendmail configuration is to have a single machine act as a mail gateway
for all the machines on your network. For instance, at Red Hat we have a machine
mail.redhat.com that does all our mail. On that machine we simply need to add
the names of machines for which mail.redhat.com will handle mail to /etc/send-
mail.cw. Here is an example:
# sendmail.cw - include all aliases for your machine
# here.
torgo.redhat.com
poodle.redhat.com
devel.redhat.com
Then on the other machines, torgo, poodle, and devel, we need to edit
/etc/sendmail.cf to "masquerade" as mail.redhat.com when sending
mail, and to forward any local mail processing to redhat.com. Find the DH and
DM lines in /etc/sendmail.cf and edit them as such:
# who I send unqualified names to
# (null means deliver locally)
DRmail.redhat.com
# who gets all local email traffic
DHmail.redhat.com
# who I masquerade as (null for no masquerading)
DMredhat.com
With this type of configuration, all mail sent will appear as if it were sent fromred-
hat.com, and any mail sent to torgo.redhat.com or the other hosts will be
delivered to mail.redhat.com.
Please be aware that if you configure your system to masquerade as another any
e-mail sent from your system to your system will be sent to the machine you are
masquerading as. For example, in the above illustration, log files that are periodi-
cally sent to root@poodle.redhat.com by the cron daemon would be sent to
root@mail.redhat.com.
50 Chapter 2:System Administration
2.10 Controlling Access to Services
As a security measure, most network services are managed by a protective
program called a TCP wrapper. The protected services are those listed in
/etc/inetd.conf that specify /usr/sbin/tcpd. tcpd can allow or deny
access to a service based on the origin of the request, and the configuration in
/etc/hosts.allow and /etc/hosts.deny.
By default Red Hat Linux allows all service requests. To disable or limit services you
can edit /etc/hosts.allow. Here is an example /etc/hosts.allow file:
ALL: redhat.com .redhat.com
in.talkd: ALL
in.ntalkd: ALL
in.fingerd: ALL
in.ftpd: ALL
This configuration allows all connections from redhat.com and *.redhat.com
machines. It also allows talk, finger, and FTP requests from all machines.
tcpd allows much more sophisticated access control, using a combination
of /etc/hosts.allow and /etc/hosts.deny. Read the tcpd(8) and
hosts_access(5) man pages for complete details.
2.11 Anonymous FTP
Setting up anonymous FTP is simple. All you need to do is install the anon-ftp RPM
package (which you may have already done at install time). Once it is installed,
anonymous FTP will be up and running.
There are a few files you might wish to edit to configure your FTP server.
/etc/ftpaccess
This file defines most of the access control for your FTP server. Some of the
things that you can do are: set up logical "groups" to control access fromdiffer-
ent sites, limit the number of simultaneous FTP connections, configure transfer
logging, and much more. Read the ftpaccess man page for complete details.
/etc/ftphosts
Section 2.12:NFS Configuration 51
The ftphosts file is used to allow or deny access to certain accounts from
various hosts. Read the ftphosts man page for details.
/etc/ftpusers
This file lists all the users that are not allowed to FTP into your machine. For
example, root is listed in /etc/ftpusers by default. That means that
you cannot FTP to your machine and log in as root. This is a good security
measure, but some administrators prefer to remove root from this file.
2.12 NFS Configuration
NFS stands for Network File System; it is a way to share files between machines
as if they were on your local hard drive. Linux can be both an NFS server and an
NFS client, which means that it can export filesystems to other systems, and mount
filesystems exported from other machines.
2.12.1 Mounting NFS Filesystems
Use the mount command to mount an NFS filesystem from another machine:
mkdir /mnt/local # Only required if /mnt/local doesnt exist
mount bigdog:/mnt/export /mnt/local
In this command, bigdog is the hostname of the NFS fileserver, /mnt/export is
the filesystem that bigdog is exporting, and /mnt/local is a directory on the local
machine where we want to mount the filesystem. After the mount command runs
(and if we have the proper permissions frombigdog) we can enter ls /mnt/lo-
cal and get a listing of the files in /mnt/export on bigdog.
2.12.2 Exporting NFS Filesystems
The file that controls what filesystems you wish to export is /etc/exports. Its
format is:
directory hostname(options)
the (options) are discretional. For example:
/mnt/export speedy.redhat.com
52 Chapter 2:System Administration
would allow speedy.redhat.com to mount /mnt/export, but:
/mnt/export speedy.redhat.com(ro)
would just allow speedy to mount /mnt/export read-only.
Each time you change /etc/exports, you must tell the NFS daemons to examine
it for new information. One simple way to accomplish this is to just stop and start the
daemons:
/etc/rc.d/init.d/nfs stop
/etc/rc.d/init.d/nfs start
Or you can restart the daemons with this command:
/etc/rc.d/init.d/nfs restart
The following will also work:
killall -HUP rpc.nfsd rpc.mountd
See the following man pages for more details: nfsd(8), mountd(8), and exports(5).
Another good reference is Managing NFS and NIS Services, by Hal Stern, published
by OReilly & Associates.
2.13 The Boot Process, Init, and Shutdown
This section contains information on what happens when you boot or shut down your
Red Hat Linux system.
2.13.1 Behind the Scenes of the Boot Process
When a computer is booted, the processor looks at the end of the system memory
for the BIOS (Basic Input/Output System) and runs it. The BIOS program is written
into read-only permanent memory, and is always ready to go. The BIOS provides
the lowest level interface to peripheral devices and controls the first step of the boot
process.
Section 2.13:The Boot Process, Init, and Shutdown 53
The BIOS tests the system, looks for and checks peripherals and then looks for a drive
to boot from. Usually, it checks the floppy drive (or CD-ROM drive on many newer
systems), if present, and then it looks on the hard drive. On the hard drive, the BIOS
looks for a Master Boot Record (MBR) starting at the first sector on the first hard
drive and starts the MBR running.
The MBR looks for the first active partition and reads the partitions boot record.
The boot record contains instructions on how to load the boot loader, LILO (LInux
LOader). The MBR then loads LILO and LILO takes over the process.
LILO reads the file /etc/lilo.conf, which spells out which operating sys-
tem(s) to configure or which kernel to start and where to install itself (for example,
/dev/hda for your hard drive). LILO displays a LILO: prompt on the screen and
waits for a preset period of time (also set in the lilo.conf file) for input from the
user. If your lilo.conf is set to give LILO a choice of operating systems, at this
time you could type in the label for whichever OS you wanted to boot.
After waiting for a set period of time (five seconds is common), LILO proceeds to
boot whichever operating system appears first in the lilo.conf file.
If LILO is booting Linux, it first boots the kernel, which is a vmlinuz file (plus a
version number, for example, vmlinuz-2.2.15-xx) located in the /boot direc-
tory. Then the kernel takes over.
The kernel looks in several different places for init (/sbin is a common location) and
runs the first one it finds. Init takes over.
Init starts (and becomes the parent or grandparent of) all of the processes which
make up your Linux system. First, it runs /etc/rc.d/rc.sysinit, which sets
your path, sets up networking if necessary, starts swapping, checks the filesystems,
and so on. Basically, rc.sysinit is taking care of everything that your system
needs to have done at system initialization. For example, on a networked system
rc.sysinit uses the information in the /etc/sysconfig/network and
/etc/sysconfig/clock files to initialize network processes and the clock.
Itmay also run rc.serial, if you have serial port processes that need to be
initialized.
54 Chapter 2:System Administration
Init looks at and implements the /etc/inittab file. The /etc/inittab file de-
scribes howthe system should be set up in each runlevel and sets the default runlevel.
This file states that /etc/rc.d/rc and /sbin/update should be run whenever
a runlevel starts.
The /sbin/update file flushes dirty buffers back to disk.
Whenever the runlevel changes, /etc/rc.d/rc starts and stops ser-
vices. First, rc sets the source function library for the system (commonly
/etc/rc.d/init.d/functions), which spells out how to start/kill a program
and how to find out the PID of a program. The rc file then finds out the current and
the previous runlevel and tells linuxconf the appropriate runlevel.
The rc file starts all of the background processes necessary for the system to run, and
looks for an rc directory for that runlevel (/etc/rc.d/rc<x>.d, where the <x>
is numbered 0-6). rc kills all of the kill scripts (their file name starts with a K) in
/rc.d/. Then it initializes all of the start scripts (their file names start with an S)
in the appropriate runlevel directory (so that all services and applications are started
correctly).
For example, for runlevel 5, rc looks into the /etc/rc.d/rc5.d directory and
finds that it needs to kill rusersd, rwalld, rwhod, mcserv, mars-nwe, apmd, and pcmcia. In
the bloody aftermath, rc looks into the same directory and finds start scripts for kmod,
network, nfsfs, randomc, syslog, atd, crond, portmap, snmpd, inet, xntpd, lpd, nfs.rpmsave, dhcpd,
ypbind, autofs, keytable, sendmail, gpm, sound, and smb.rpmsave. And life begins anew.
The /etc/inittab file forks a getty process for each virtual console (login
prompts) for each runlevel (runlevels 2-5 get all six; runlevel 1, which is single
user mode, only gets one console; runlevels 0 and 6 get no virtual consoles).
/etc/inittab also states that gdm, the X logon manager, should start in runlevel
5.
Also, /etc/inittab describes how the system should handle translating [Ctrl]-[Alt]-[Delete]
into something like the command /sbin/shutdown -t3 -r now. And finally,
/etc/inittab states what the system should do in case of power failures.
At this point, you should be looking at a login prompt. All that, and it only took a
few seconds.
Section 2.13:The Boot Process, Init, and Shutdown 55
Next, well discuss information on the files in /etc/sysconfig.
2.13.2 Sysconfig Information
The following information outlines the various files in /etc/sysconfig, their
function, and their contents.
Files in /etc/sysconfig
The following files are normally found in /etc/sysconfig:
/etc/sysconfig/clock
/etc/sysconfig/hwconf (this should be ignored for editing)
/etc/sysconfig/mouse
/etc/sysconfig/sendmail
/etc/sysconfig/apmd
/etc/sysconfig/init
/etc/sysconfig/keyboard
/etc/sysconfig/network
/etc/sysconfig/pcmica
/etc/sysconfig/soundcard (which is written by sndconfig)
Lets take a look at each one.
/etc/sysconfig/clock
The /etc/sysconfig/clock file controls the interpretation of values read from
the system clock. Earlier releases of Red Hat Linux used the following values (which
are deprecated):
CLOCKMODE=mode, where mode is one of the following:
GMT -- indicates that the clock is set to UTC.
ARC -- on Alpha only indicates the ARC consoles 42-year time offset is in
effect.
56 Chapter 2:System Administration
Currently, the correct values are:
UTC=boolean, where boolean is the following:
true -- indicates that the clock is set to UTC. Any other value indicates that
it is set to local time.
ARC=boolean, where boolean is the following:
true-- (for Alpha-based systems only) Indicates the ARCconsoles 42-year
time offset is in effect. Any other value indicates that the normal UNIX epoch
is assumed.
ZONE="filename" -- indicates the zonefile under /user/share/zone-
info that /etc/localtime is a copy of, for example:
ZONE="US/Eastern"
/etc/sysconfig/hwconf
The /etc/sysconfig/hwconf file lists all the hardware that kudzu detected on
your system, as well as the drivers used, vendor ID and device ID information. It is
not meant to be edited. If you do edit it, devices could suddenly show up as being
added or removed.
/etc/sysconfig/mouse
The /etc/sysconfig/mouse file is used to specify information about the avail-
able mouse. The following values may be used:
MOUSETYPE=type, where type is one of the following:
microsoft -- A Microsoft mouse.
mouseman -- A MouseMan mouse.
mousesystems -- A Mouse Systems mouse.
ps/2 -- A PS/2 mouse.
msbm -- A Microsoft bus mouse.
Section 2.13:The Boot Process, Init, and Shutdown 57
logibm -- A Logitech bus mouse.
atibm -- An ATI bus mouse.
logitech -- A Logitech mouse.
mmseries -- An older MouseMan mouse.
mmhittab -- An mmhittab mouse.
XEMU3=emulation, where emulation is one of the following:
yes -- Three mouse buttons should be emulated.
no -- The mouse already has three buttons.
In addition, /dev/mouse is a symlink that points to the actual mouse device.
/etc/sysconfig/sendmail
The /etc/sysconfig/sendmail allows messages to be sent to one or more
recipients, routing the message over whatever networks are necessary. The file sets
the default values for the sendmail program to run. Its default values are to run as
a background daemon, and to check its queue once an hour in case something has
backed up.
The following values may be used:
DAEMON=answer, where answer is one of the following:
yes -- Sendmail should be configured. yes implies -bd.
no -- Sendmail should not be configured.
QUEUE=1h which is given to sendmail as -q$QUEUE. The -q option is not given
to sendmail if /etc/sysconfig/sendmail exists and QUEUE is empty or
undefined.
58 Chapter 2:System Administration
/etc/sysconfig/apmd
The /etc/sysconfig/apmd is used by apmd, as a configuration for what things
to start/stop/change on suspend or resume. It is set up to turn on or off apmd dur-
ing startup, depending on whether your hardware supports Advanced Power Management
(apm), or if you choose not to use it.
/etc/sysconfig/init
The /etc/sysconfig/init file controls how the system will look during
bootup.
The following values may be used:
BOOTUP=<some bootup mode>, where <some bootup mode> is one of the
following:
BOOTUP=color means new (as of Red Hat Linux 6.0) boot display.
BOOTUP=verbose means old style display.
Anything else means new display, but without ANSI-formatting.
LOGLEVEL=<a number>, where <a number> sets the initial console logging
level for the kernel. The default is 7; 8 means everything (including debugging);
1 means nothing except kernel panics. syslogd will override this once it starts.
RES_COL=<a number>, where <a number> is a column of the screen to start
status labels at. Defaults to 60.
MOVE_TO_COL=<a command>, where <a command> moves the cursor to
$RES_COL. Defaults to ANSI sequences output by echo -e.
SETCOLOR_SUCCESS=<a command>, where <a command> sets the color
to a color indicating success. Defaults to ANSI sequences output by echo -e,
setting the color to green.
SETCOLOR_FAILURE=<a command>, where <a command> sets the color
to a color indicating failure. Defaults to ANSI sequences output by echo -e,
setting the color to red.
Section 2.13:The Boot Process, Init, and Shutdown 59
SETCOLOR_WARNING=<a command>, where <a command> sets the color
to a color indicating warning. Defaults to ANSI sequences output by echo -e,
setting the color to yellow.
SETCOLOR_NORMAL=<a command>, where <a command> sets the color to
normal. Defaults to ANSI sequences output by echo -e.
MAGIC_SYSRQ=an answer, where an answer is one of the following:
yes -- Enables the magic sysrq key.
no -- Disables the magic sysrq key, and [Stop]-[A] (break on serial console) on
SPARC.
PROMPT=an answer, where an answer is one of the following:
yes -- Enables the key check for interactive mode.
no -- Disables the key check for interactive mode.
/etc/sysconfig/keyboard
The /etc/sysconfig/keyboard file controls the behavior of the keyboard.
The following values may be used:
KEYTABLE=file, where file is the name of a keytable file. For example:
KEYTABLE="/usr/lib/kbd/keytables/us.map"
KEYBOARD=sun|pc, which is used on SPARCs only. sun means a Sun key-
board is attached on /dev/kbd, pc means a PS/2 keyboard is on a PS/2 port.
/etc/sysconfig/network
The /etc/sysconfig/network file is used to specify information about the
desired network configuration. The following values may be used:
NETWORKING=answer, where answer is one of the following:
yes -- Networking should be configured.
60 Chapter 2:System Administration
no -- Networking should not be configured.
HOSTNAME=hostname, where hostname should be the FQDN(Fully Qualified
Domain Name), but can be whatever hostname you want.
Please Note
For compatibility with older software that people might
install (such as trn), the /etc/HOSTNAMEfile should
contain the same value as here.
FORWARD_IPV4=answer, where answer is one of the following:
yes -- Perform IP forwarding.
no -- Do not perform IP forwarding.
(The current Red Hat Linux installation sets this to "no" by default [for RFC
compliance], but if FORWARD_IPV4 is not set at all, forwarding is enabled for
compatibility with the configuration files used on Red Hat Linux versions 4.2 and
earlier.)
GATEWAY=gw-ip, where gw-ip is the IP address of the networks gateway.
GATEWAYDEV=gw-dev, where gw-dev is the gateway device (e.g. eth0).
NISDOMAIN=dom-name, where dom-name is the NIS domain name.
/etc/sysconfig/pcmcia
The /etc/sysconfig/pcmcia file is used to specify PCMCIA configuration
information. The following values may be used:
PCMCIA=answer, where answer is one of the following:
yes -- PCMCIA support should be enabled.
Section 2.13:The Boot Process, Init, and Shutdown 61
no -- PCMCIA support should not be enabled.
PCIC=pcic-type, where pcic-type is one of the following:
i82365 -- The computer has an i82365-style PCMCIA socket chipset.
tcic -- The computer has a tcic-style PCMCIA socket chipset.
PCIC_OPTS=option, where option is the socket driver (i82365 or tcic) timing
parameters.
CORE_OPTS=option, where option is the list of pcmcia_core options.
CARDMGR_OPTS=option, where option is the list of options for the PCMCIA
cardmgr (such as -q, quiet mode; -m, looks for loadable kernel modules in the
specified director; and so on, read the cardmgr man page for more information).
/etc/sysconfig/soundcard
The /etc/sysconfig/soundcard file is generated by sndconfig and should not
be modified. It is used by /etc/rc.d/init.d/sound to set up your system
properly. The sole use of this is to determine what card entry in the menu to pop up
by default the next time sndconfig is run.
It may contain the following:
CARDTYPE=<a card>, where <a card> is seen as, for example, CARD-
TYPE=SB16.
Files in /etc/sysconfig/network-scripts/
The following files are normally found in /etc/sysconfig/net-
work-scripts:
/etc/sysconfig/network-scripts/ifup
/etc/sysconfig/network-scripts/ifdown
62 Chapter 2:System Administration
/etc/sysconfig/network-scripts/network-functions
/etc/sysconfig/network-scripts/ifcfg-<interface-name>
/etc/sysconfig/network-scripts/ifcfg-<interface-
name>-<clone-name>
/etc/sysconfig/network-scripts/chat-<interface-name>
/etc/sysconfig/network-scripts/dip-<interface-name>
/etc/sysconfig/network-scripts/ifup-post
/etc/sysconfig/network-scripts/ifdhcpc-done
Lets take a look at each one.
/etc/sysconfig/network-scripts/ifup,
/etc/sysconfig/network-scripts/ifdown
These are symbolic links to /sbin/ifup and /sbin/ifdown, respectively.
These are the only two scripts in this directory that should be called directly;
these two scripts call all the other scripts as needed. These symlinks are here for
legacy purposes only -- they will probably be removed in future versions, so only
/sbin/ifup and /sbin/ifdown should currently be used.
These scripts take one argument normally: the name of the device (e.g. "eth0").
They are called with a second argument of "boot" during the boot sequence so that
devices that are not meant to be brought up on boot (ONBOOT=no, [see below]) can
be ignored at that time.
/etc/sysconfig/network-scripts/network-functions
Not really a public file. Contains functions which the scripts use for bringing inter-
faces up and down. In particular, it contains most of the code for handling alternative
interface configurations and interface change notification through netreport.
/etc/sysconfig/network-scripts/ifcfg-<interface-name>,
/etc/sysconfig/network-scripts/ifcfg-<interface-name>-<clone-name>
The first file defines an interface, while the second file contains only the parts of
the definition that are different in a "clone" (or alternative) interface. For example,
Section 2.13:The Boot Process, Init, and Shutdown 63
the network numbers might be different, but everything else might be the same, so
only the network numbers would be in the clone file, while all the device information
would be in the base ifcfg file.
The items that can be defined in an ifcfg file depend on the interface type.
The following values are common to all base files:
DEVICE=name, where name is the name of the physical device (except dynam-
ically-allocated PPP devices where it is the "logical name").
IPADDR=addr, where addr is the IP address.
NETMASK=mask, where mask is the netmask value.
NETWORK=addr, where addr is the network address.
BROADCAST=addr, where addr is the broadcast address.
GATEWAY=addr, where addr is the gateway address.
ONBOOT=answer, where answer is one of the following:
yes -- This device should be activated at boot-time.
no -- This device should not be activated at boot-time.
USERCTL=answer, where answer is one of the following:
yes -- Non-root users are allowed to control this device.
no -- Non-root users are not allowed to control this device.
BOOTPROTO=proto, where proto is one of the following:
none -- No boot-time protocol should be used.
bootp -- The BOOTP protocol should be used.
dhcp -- The DHCP protocol should be used.
64 Chapter 2:System Administration
The following values are common to all PPP and SLIP files:
PERSIST=answer, where answer is one of the following:
yes -- This device should be kept active at all times, even if deactivated after
a modem hang up.
no -- This device should not be kept active at all times.
MODEMPORT=port, where port is the modem ports device name (for example,
"/dev/modem").
LINESPEED=baud, where baud is the modems linespeed (for example,
"115200").
DEFABORT=answer, where answer is one of the following:
yes -- Insert default abort strings when creating/editing the script for this
interface.
no -- Do not insert default abort strings when creating/editing the script for
this interface.
The following values are common to all PPP files:
DEFROUTE=answer, where answer is one of the following:
yes -- Set this interface as the default route.
no -- Do not set this interface as the default route.
ESCAPECHARS=answer, where answer is one of the following:
yes -- Use the pre-defined asyncmap.
no -- Do not use the pre-defined asyncmap.
Section 2.13:The Boot Process, Init, and Shutdown 65
(This represents a simplified interface; it doesnt let people specify which char-
acters to escape. However, almost everyone can use an asyncmap of 00000000
anyway, and its possible to set PPPOPTIONS to use an arbitrary asyncmap if so
desired.)
HARDFLOWCTL=answer, where answer is one of the following:
yes -- Use hardware flow control.
no -- Do not use hardware flow control.
PPPOPTIONS=options, where options is an arbitrary option string. It
is placed last on the command line so it can override other options (such as
asyncmap) that were specified previously.
PAPNAME=name, where name is used as part of "name $PAPNAME" on the
pppd command line.
Note that the "remotename" option is always specified as the logical PPP de-
vice name, like "ppp0" (which might perhaps be the physical device ppp1 if
some other PPP device was brought up earlier...), which makes it easy to manage
PAP/CHAP files -- name/password pairs are associated with the logical PPP de-
vice name so that they can be managed together.
In principle, there shouldnt anything that would keep the logical PPP device
names from being "worldnet" or "myISP" instead of "ppp0" -- "pppN."
REMIP=addr, where addr is the remote IP address (which is normally unspec-
ified).
MTU=value, where value is the value to be used as MTU.
MRU=value, where value is the value to be used as MRU.
DISCONNECTTIMEOUT=value, where value represents the number of sec-
onds to wait before re-establishing the connection after a successfully-connected
session terminated.
66 Chapter 2:System Administration
RETRYTIMEOUT=value, where value represents the number of seconds to
wait before re-attempting to establish a connection after a previous attempt has
failed.
/etc/sysconfig/network-scripts/chat-<interface-name>
This file is a chat script for PPP or SLIP connections, and is intended to establish the
connection. For SLIP devices, a DIP script is written from the chat script; for PPP
devices, the chat script is used directly.
/etc/sysconfig/network-scripts/dip-<interface-name>
This write-only script is created from the chat script by netcfg. Do not modify this
file. In the future, this file may disappear and instead will be created on-the-fly from
the chat script.
/etc/sysconfig/network-scripts/ifup-post
This file is called when any network device (except a SLIP device) comes up.
Calls /etc/sysconfig/network-scripts/ifup-routes to bring up
static routes that depend on that device. Brings up aliases for that device. Sets the
hostname if it is not already set and a hostname can be found for the IP for that
device. Sends SIGIO to any programs that have requested notification of network
events.
Could be extended to fix up name service configuration, call arbitrary scripts, and
more, as needed.
/etc/sysconfig/network-scripts/ifdhcpc-done
This file is called by dhcpcd once DHCP configuration is complete; sets up
/etc/resolv.conf from the version dhcpcd dropped in /etc/dhcpc/re-
solv.conf.
2.13.3 System V Init
This section is a brief description of the internals of the boot process. It discusses
how the machine boots using SysV init, as well as the differences between the init used
in older Linux releases, and SysV init.
Section 2.13:The Boot Process, Init, and Shutdown 67
The Init program is run by the kernel at boot time. It is in charge of starting all the
normal processes that need to run at boot time. These include the getty processes that
allow you to log in, NFS daemons, FTP daemons, and anything else you want to run
when your machine boots.
SysV init is quickly becoming the standard in the Linux world to control the startup of
software at boot time, because it is easier to use and more powerful and flexible than
the traditional BSD init.
SysV init also differs from BSD init in that the configuration files are in a subdirec-
tory of /etc instead of residing directly in /etc. In /etc/rc.d, you will find
rc.sysinit and the following directories:
init.d
rc0.d
rc1.d
rc2.d
rc3.d
rc4.d
rc5.d
rc6.d
The init.d directory contains a variety of scripts. Basically, you must have one
script for each service you may need to start at boot time or when entering another
runlevel. Services include things like networking, nfs, sendmail, httpd, and so
on. Services do not include things like setserial that must only be run once and
then exited. Things like that should go in rc.local or rc.serial.
If you want rc.local, it should be in /etc/rc.d. Most systems include one even
though it doesnt do much. You can also include an rc.serial file in /etc/rc.d
if you need to perform serial port specific tasks at boot time.
The chain of events is as follows:
The kernel looks in several places for init and runs the first one it finds
init runs /etc/rc.d/rc.sysinit
rc.sysinit handles most of the boot loaders processes and then runs
rc.serial (if it exists)
68 Chapter 2:System Administration
init runs all the scripts for the default runlevel.
init runs rc.local
The default runlevel is decided in /etc/inittab. You should have a line close to
the top like:
id:3:initdefault:
From this, youd look in the second column and see that the default runlevel is 3. If
you want to change it, you can edit /etc/inittab by hand. Be very careful when
you are editing the inittab file. If you do mess up, you can fix it by rebooting and
typing:
LILO boot: linux single
This should allow you to boot into single user mode so you can re-edit inittab to
its previous value.
Now, how does it run all the right scripts? If you enter ls -l on rc3.d, you might
see something like:
lrwxrwxrwx 1 root root 17 3:11 S10network -> ../init.d/network
lrwxrwxrwx 1 root root 16 3:11 S30syslog -> ../init.d/syslog
lrwxrwxrwx 1 root root 14 3:32 S40cron -> ../init.d/cron
lrwxrwxrwx 1 root root 14 3:11 S50inet -> ../init.d/inet
lrwxrwxrwx 1 root root 13 3:11 S60nfs -> ../init.d/nfs
lrwxrwxrwx 1 root root 15 3:11 S70nfsfs -> ../init.d/nfsfs
lrwxrwxrwx 1 root root 18 3:11 S90lpd -> ../init.d/lpd.init
lrwxrwxrwx 1 root root 11 3:11 S99local -> ../rc.local
What youll notice is that there are no "real" files in the directory. Everything there
is a link to one of the scripts in the init.d directory. The links also have an "S"
and a number at the beginning. The "S" means to start this particular script and a
"K" would mean to stop it. The number in the file name is for ordering purposes. Init
will start all the services based on the order in which they appear. You can duplicate
numbers, but it will only confuse you somewhat. You only need to use a two digit
number, along with an upper case "S" or "K" to start or stop the services you require.
Section 2.13:The Boot Process, Init, and Shutdown 69
How does init start and stop services? Simple. Each of the scripts is written to accept
an argument which can be "start" and "stop". You can execute those scripts by
hand, in fact, with a command like:
/etc/rc.d/init.d/httpd stop
This will stop the httpd server. init reads the name and if it has a "K," it calls the
script with the "stop" argument. If it has an "S" it calls the script with a "start"
argument.
Why all these runlevels? Some people want an easy way to set up machines to be
multi-purpose. You could have a "server" runlevel that just runs httpd, sendmail,
networking, etc. Then you could have a "user" runlevel that runs gdm, networking,
and so on.
2.13.4 Init Runlevels
Generally, Red Hat Linux operates in runlevel 3 -- full multi-user mode. The follow-
ing runlevels are defined in Red Hat Linux:
0 -- Halt
1 -- Single user mode
2 -- Multi-user mode, without NFS
3 -- Full multi-user mode
4 -- Not used
5 -- Full multi-user mode (with an X-based login screen)
6 -- Reboot
If your machine gets into a state where it will not boot due to a bad /etc/inittab,
or will not let you log in because you have a corrupted /etc/passwdor have simply
forgotten your password, boot into single user mode by typing linux single at
the LILO boot prompt. A very bare system will boot and you will have a shell from
which you can fix things.
70 Chapter 2:System Administration
2.13.5 Initscript Utilities
The chkconfig utility provides a simple command-line tool for maintaining the
/etc/rc.d directory hierarchy. It relieves system administrators from having to
directly manipulate the numerous symlinks in /etc/rc.d.
In addition, there is the ntsysv utility, that provides a screen-oriented interface,
versus chkconfigs command-line interface.
Please see the chkconfig and ntsysv man pages for more information.
2.13.6 Running Programs at Boot Time
The file /etc/rc.d/rc.local is executed at boot time, after all other initial-
ization is complete, and whenever you change runlevels. You can add additional
initialization commands here. For instance, you may want to start up additional dae-
mons, or initialize a printer. In addition, if you require serial port setup, you can edit
/etc/rc.d/rc.serial, and it will be executed automatically at boot time.
The default /etc/rc.d/rc.local simply creates a nice login banner with your
kernel version and machine type.
2.13.7 Shutting Down
To shut down Red Hat Linux, issue the shutdown command. You can read the
shutdown man page for complete details, but the two most common usages are:
shutdown -h now
shutdown -r now
Each will cleanly shutdown the system. After shutting everything down, the -h op-
tion will halt the machine, and the -r option will reboot.
Although the reboot and halt commands are now "smart" enough to invoke
shutdown if run while the system is in runlevels 1-5, it is a bad habit to get into,
as not all Linux-like operating systems have this feature.
Section 2.14:Rescue Mode 71
2.14 Rescue Mode
When things go wrong, there are several ways to work on fixing them. However, they
require that you understand the system well. We will present the ways that you can
boot into rescue modes where you can use your own knowledge to rescue the system.
2.14.1 What is Rescue Mode?
Rescue mode is a term used to describe a method of booting a small Linux environ-
ment completely from a diskette, CD or other method.
What follows in this section may help you recover from a problem at some point.
As the name implies, rescue mode is there to rescue you from something. In normal
operation, your Red Hat Linux system uses files located on your systems hard drive
to do everything -- run programs, store your files, and more.
However, there may be times when you are unable to get Linux running completely
enough to access its files on your systems hard drive. By using rescue mode, its
possible to access the files stored on your systems hard drive, even if you cant ac-
tually run Linux from that hard drive.
Normally, youll need to get into rescue mode for one of two reasons:
You are unable to boot Linux, and youd like to fix it.
You are having hardware or software problems, and you want to get a few im-
portant files off your systems hard drive.
Lets take a closer look at each of these scenarios.
Unable to boot Linux
Many times this is caused by the installation of another operating system after youve
installed Red Hat Linux. Some other operating systems assume that you have no
other operating systems on your computer, and overwrite the Master Boot Record (or
MBR) that originally contained the LILO bootloader. If LILO is overwritten in this
manner, youre out of luck -- unless you can get into rescue mode.
72 Chapter 2:System Administration
Hardware/software problems
There can be as many different situations under this category as there are systems run-
ning Linux. Things like failing hard drives and forgetting to run LILO after building
a new kernel are just two instances that can keep you from booting Red Hat Linux. If
you can get into rescue mode, you might be able to resolve the problem -- or at least
get copies of your most important files.
To boot your system in rescue mode, enter the following parameter at the installation
boot prompt:
boot: linux rescue
You can get to the installation boot prompt in one of these ways:
By booting your system from the diskette or CD-ROM that came with your Red
Hat Linux boxed set.
By booting from a network or PCMCIA boot diskette. These methods assume
your network connection is working and require you to identify the network host
and transfer type. For an explanation of how to specify this information, see
"Installing over the Network" in Chapter 10, Installing Red Hat Linux via Text
Mode.
Once you have your system in rescue mode, a prompt appears:
bash#
From this prompt, you can run the commands listed below:
anaconda gzip mkfs.ext2 ps
badblocks head mknod python
bash hwclock mkraid python1.5
cat ifconfig mkswap raidstart
chatter init mlabel raidstop
chmod insmod mmd rcp
chroot less mmount rlogin
clock ln mmove rm
collage loader modprobe rmmod
cp ls mount route
cpio lsattr mpartition rpm
Section 2.14:Rescue Mode 73
dd lsmod mrd rsh
ddcprobe mattrib mread sed
depmode mbadblocks mren sh
df mcd mshowfat sync
e2fsck mcopy mt tac
fdisk mdel mtools tail
fsck mdeltree mtype tar
fsck.ext2 mdir mv touch
ftp mdu mzip traceroute
genhdlist mformat open umount
gnome-pty-helper minfo pico uncpio
grep mkdir ping uniq
gunzip mke2fs probe zcat
However, if your root filesystem is undamaged, you can mount it and then run any
standard Linux utility. For example, suppose your root filesystem is in /dev/hda5.
Heres how to mount this partition:
mount -t ext2 /dev/hda5 /foo
Where /foo is a directory that you have created.
Now you can run chroot, fsck, man, and other utilities. At this point, you are
running Linux in single-user mode.
If you dont know the names of your Linux partitions, you can guess: mounting non-
existent partitions will do no harm.
Booting Single-User Mode Directly
You may be able to boot single-user mode directly. If your system boots, but does
not allow you to log in when it has completed booting, try rebooting and specifying
one of these options at the LILO boot prompt:
LILO boot: linux single
LILO boot: linux emergency
In single-user mode, you computer boots to runlevel 1. Your local filesystems will be
mounted but your network will not be activated. You get a usable systemmaintenance
shell.
74 Chapter 2:System Administration
In emergency mode, you are booted into the most minimal environment possible. The
root filesystem will be mounted read-only and almost nothing will be set up. The
main advantage of this over linux single is that your init files are not loaded. If
init is corrupted or not working, you can still mount filesystems to recover data that
could be lost during a re-installation.
A Handy Trick
Have you ever rebuilt a kernel and, eager to try out your newhandiwork, rebooted be-
fore running LILO? And you didnt have an entry for an older kernel in lilo.conf?
Read on
In many cases, its possible to boot your Red Hat Linux/Intel system from the Red
Hat Linux boot disk with your root filesystem mounted and ready to go. Heres how:
Enter the following command at the boot disks boot: prompt:
linux single root=/dev/hdXX initrd=
(Replace the XX in /dev/hdXX with the appropriate letter and number for your root
partition.)
What does this do? First, it starts the boot in single-user mode, with the root partition
set to your root partition. The empty initrd specification bypasses the installa-
tion-related image on the boot disk, which will cause you to enter single-user mode
immediately.
Is there a downside? Unfortunately, yes. Because the kernel on the Red Hat Linux
boot disk only has support for IDE built-in, those of you with SCSI-based systems
wont be able to use this trick. In that case, youll have to use the boot/rescue disk
combination mentioned above.
Section 3.1:System Configuration with linuxconf 75
3 System Configuration
One of the main strengths of Red Hat Linux is that the operating system can be con-
figured to do just about anything. In the past, this meant editing sometimes cryptic
configuration files by hand, then restarting system services and crossing your fingers
in the hope that your changes were correctly made. Additionally, the variety of con-
figuration options can be bewildering to new users, who may not know where to look
for a particular configuration file.
Red Hat Linux provides two system configuration utilities: linuxconf and the control
panel. The control panel provides a launcher for various Red Hat system configu-
ration tools, including linuxconf. Instructions on how to use the control panel and the
tools it includes can be found in Section 3.2, System Configuration with the Control
Panel.
The linuxconf configuration tool can ease some of the burdens of system configuration.
Linuxconf is both:
A configuration interface -- You type the values needed to configure your system
into a user interface.
A configuration activator -- When youre satisfied with your edits, you tell linux-
conf to apply the changes youve made.
While linuxconf can do nearly everything the control panel tools can, there are two
areas in which the control panel still holds the upper hand:
Printer configuration
Loading kernel modules to support new hardware
Lets take a look at linuxconf.
3.1 System Configuration with linuxconf
Linuxconf allows you to configure and control various aspects of your system, and is
capable of handling a wide range of programs and tasks. Complete documentation
of linuxconf could be a separate book in its own right and is certainly more than we can
76 Chapter 3:System Configuration
cover in this chapter. Instead, well focus on common tasks such as adding new users
and getting connected to a network.
More information on linuxconf, including its most recent release can be found at the
linuxconf website:
http://www.solucorp.qc.ca/linuxconf/
The linuxconf website includes fairly extensive information, including a description,
rationale, history, list of contacts, and a lot of other information in addition to the
software. The website is maintained by linuxconfs creator and developer, Jacques
Gelinas, so it includes the latest news about linuxconf.
This chapter will go into detail on just a fewof linuxconfs capabilities. If you just need
a quick reference to show you where to go in linuxconf for the tasks covered by this
chapter, see Section 3.1.15, Finding Your Way Through linuxconf.
If you need more help with linuxconf, please try these sources:
The linuxconf FAQ, which is available at http://www.xc.org/jonathan/linuxconf-
faq.html.
The archives of the linuxconf mailing list, which are available at
http://hub.xc.org/scripts/lyris.pl?visit=linuxconf.
After youve checked the linuxconf FAQ and the archives of the linuxconf list, you
might try posting your question to the linuxconf list. Subscription information for
the linuxconf list is available at the linuxconf website (http://www.solucorp.qc.ca/lin-
uxconf/); click on the "Mailing lists" link.
Please note that this list is for questions pertaining to linuxconf, and is not intended
for general Linux questions.
3.1.1 Running linuxconf
Youll need to be root to run linuxconf
Section 3.1:System Configuration with linuxconf 77
3.1.2 Linuxconf User Interfaces
Linuxconf has four user interfaces:
Text-based -- Using the same user interface style as the Red Hat Linux text-mode
installation program, the text-based interface makes it easy to navigate your way
through linuxconf if you arent running X. If you are running X, you can switch
to a virtual console, log in as root, and type linuxconf to bring up text-mode
linuxconf.
Use the [Tab] and [arrow] keys to navigate the text-mode screens. A down arrow
on a line indicates that a pull-down menu exists on that line. The [Ctrl]-[X] key
combination will make pull-down menus appear.
Graphical user interface (GUI) -- linuxconf can take advantage of X, and give you
an easy-to-use "point and click" tree menu interface (see Section 3.1.3, Tree Menu
Interface for more information). Red Hat Linux includes a GUI interface for
linuxconf called gnome-linuxconf.
This document will display linuxconf screens using the gnome-linuxconf interface,
but you shouldnt have any trouble using the other interfaces with the instructions
provided here.
Web-based -- A Web-based interface makes remote system administration a
breeze; it can also be displayed with the Lynx text-mode browser.
To use the linuxconf Web interface, use your browser to connect to port 98 on the
machine running linuxconf (i.e., http://your_machine:98).
Before you use the Web-based interface, youll need to configure linuxconf to allow
connections from the machine running the browser. See Section 3.1.4, Enabling
Web-Based linuxconf Access for instructions on enabling Web access to linuxconf.
Command line -- linuxconfs command-line mode is handy for manipulating your
systems configuration in scripts.
Linuxconf will start in either character-cell or X mode, depending on your DISPLAY
environment variable. The first time you run linuxconf, an introductory message will
be shown; although it is only displayed once, accessing help from the main screen
will give you the same basic information.
78 Chapter 3:System Configuration
Linuxconf includes some context-specific help. For information on any specific aspect
of linuxconf, select Help from the screen youd like help with. Note that not all help
screens are complete at this time; as help screens are updated, they will be included
in subsequent versions of linuxconf.
3.1.3 Tree Menu Interface
Linuxconf provides a tree menu of its hierarchical structure.
Figure 31 Linuxconf Tree Menu View
Finding the appropriate panel should be simple and fast. Collapse and expand sec-
tions by clicking on the + or - next to the menu item.
Selected entries will appear as tabs in the right-hand panel and will remain there until
closed. If you end up with more tabs open than you like, just select Cancel on the
bottom of each tab to close it without making any changes, or Accept to implement
them.
Section 3.1:System Configuration with linuxconf 79
Please Note
If youve grown fond of the older X Window System inter-
face, its still available. To return to it:
1. Open Control => Control files and systems => Configure linuxconf modules
2. De-select the treemenu check box
3. Click Accept
4. Click Quit
5. Restart linuxconf
3.1.4 Enabling Web-Based linuxconf Access
For security reasons, Web-based access to linuxconf is disabled by default. Before
attempting to access linuxconf with a Web browser, youll need to enable access. Heres
how to do it:
1. Open Config => Networking => Misc => Linuxconf network access
2. In the Linuxconf html access control dialog box, enter the hostname of any comput-
ers that should be allowed access to Linuxconf. This includes your own system, if
you wish to use the Web-based interface locally. Web accesses related to linuxconf
may be logged to your systems htmlaccess.log file by selecting the check
box.
3. Select the Accept button.
Web-based access should be enabled. To test it out, go to a system that you added to
the access control list. Then, launch your Web browser, and enter the following URL:
http://<host>:98/
(Replace <host> with your systems hostname, of course.) You should see the main
linuxconf page. Note that you will need to enter your systems root password to gain
access beyond the first page.
80 Chapter 3:System Configuration
You can also enable network-wide access to linuxconf by following the same steps, by
entering a network name instead of a hostname.
3.1.5 Adding a User Account
Adding a user is one of the most basic tasks you will encounter in administering your
system. To add a user:
Open Config => Users accounts => Normal => User accounts. Linuxconf may show
you a filter screen (see Figure 32, Filter Control Screen).
Figure 32 Filter Control Screen
You can set the filter cutoff using Control => Features. The Trigger for filter field
sets the number of entries that will pop up a filter screen. You can use the filter
screen to select a smaller range of accounts than the full list. To get the full list,
select Accept without changing any of the parameters. For detailed information
on the various filters, select the Help button on the Filter control screen.Once youve
applied or bypassed the filter, youll see the Users accounts tab (see Figure 33,
Users Accounts Screen).
Section 3.1:System Configuration with linuxconf 81
Figure 33 Users Accounts Screen
Select Add. This will open the User account creation tab (see Figure 34, User
Account Creation).
The User account creation screen includes the Base info, Mail settings and Privileges sec-
tions. Only the Login name is required, but you should be aware of the other fields,
which you may or may not want to fill in.
82 Chapter 3:System Configuration
Figure 34 User Account Creation
Base info for User Accounts
The Login name is the name of the account and is usually all lowercase letters. First or
last names, initials or some combination thereof are fairly common login names. For
a user named John T. Smith, smith, john, jts, or jsmithwould be common user
names. Of course spike or something else works just fine, too. You can also use
numbers, so jts2 would be fine if you had a second person with the same initials.
There is no default for this field.
The Full name is the name of the user or the account. For an individual, it would
be their name, John T. Smith for example. If the account represents a position
rather than a person, the full name might be the title. So an account called webmas-
ter might have a full name of Red Hat Webmaster or just Webmaster. There
is no default for this field.
Since Red Hat Linux uses the User Private Group scheme, each user will be assigned
to a default group consisting only of the user. For more information on User Private
Groups, see Section 2.3.3, User Private Groups.
Section 3.1:System Configuration with linuxconf 83
In the Supplementary groups field, you can specify additional groups. Group names
should be separated by spaces. The default for this field is blank, meaning no sup-
plementary groups are specified.
The Home directory specifies the home or login directory for the account. The default
is /home/login, where login is replaced by the login name. A home directory
is your starting point in the directory structure when you log in, or if in X, for each
Xtermwindowopened. This is also where account specific preference files are stored.
The Command interpreter is the default shell for the account. The bash shell is the
default shell for Red Hat Linux.
The User ID (UID) is the number associated with each user account. This is automat-
ically generated by the system when the account is created, so just leave this field
blank. The system uses the UID to identify an account.
Mail settings for User Accounts
The Redirect messages to field sets the system to forward e-mail messages sent to the
user to this address instead.
An E-mail alias is a supplemental e-mail address that will be accepted by the
system and forwarded on to the user. For example, you could add the alias
jane_smith@yourdomain.com to user smitjs account. Then, e-mail sent to
jane_smith@yourdomain.com would automatically be forwarded to smitj@your-
domain.com.
Privileges for User Accounts
In the Privileges section, you can grant access and/or control over various aspects of
system configuration. As a default, regular users are denied all privileges on this
screen. You may instead choose to grant or to silently grant them specific privileges.
The difference between Granted and Granted/silent is that if the privilege is granted,
linuxconf will ask for the users password before allowing them the privilege. If the
privilege is granted silently, linuxconf will not prompt for their password.
Generally, careful system administrators wont grant users any system configuration
privileges unless it is absolutely necessary. If you do grant privileges, be careful when
granting them silently. If a user with silently granted privileges logs in to his/her
84 Chapter 3:System Configuration
machine and walks away, their privileges are wide open for the next person who sits
down at their desk. Silently granted privileges are less risky if used on machines in a
physically restricted area.
May use linuxconf: the user is allowed to access all of linuxconfs capabilities, and they
can set up or change linuxconf parameters. Note that use of linuxconf is separate from
the privilege of activating configuration changes. System administrators might want
to grant the use of linuxconf, but deny the activation privilege, so that the sysadmin has
a final "yes/no" on whether to activate any configuration changes.
May activate config changes: After you change a parameter in linuxconf, at some point
youll have to indicate to linuxconf that the changes you made should be applied. De-
pending upon the flavor of linuxconf that youre using, you might do this by clicking
on an Activate the changes button in GUI linuxconf, or clicking on an Accept button in
Web-based linuxconf, or selecting an Accept button in text-mode linuxconf, etc.
You can grant the privilege of activating changes to a user. In that case, the user will
be able to activate any changed system configuration parameters in linuxconf.
May shutdown: A user can be granted the right to shutdown the system. Note that Red
Hat Linux is set in /etc/inittab to cleanly shutdown following the [Ctrl]-[Alt]-[Del]
keystroke combination.
Once you have entered the login name and any other desired information select the
Accept button at the bottom of the screen. If you decide against creating a new user,
select Cancel instead.
Section 3.1:System Configuration with linuxconf 85
Figure 35 Change Password Screen
When you click on Accept linuxconf will prompt you to enter the password, as in Fig-
ure 35, Change Password Screen. Youll have to re-type the password, to prevent
unusable passwords caused by typos. Passwords must be at least six characters in
length, but you can increase the required length and set other parameters for users
passwords at the Users Accounts => Password & Account Policies screen.
Good passwords contain a combination of letters, numbers, and special characters.
It should use both upper case and lower case letters. Dont use your username, your
anniversary, your social security number, your dogs name, your middle name or the
word root. Dont use any variation of a word associated with your account or with
yourself. Dont use a word that can be found in a dictionary; dictionary words are
easy to crack.
A simple technique for creating a password is to use the first letters from each word
of a phrase that is familiar to you (a line from a favorite song might be appropriate).
Make a few letters uppercase, and insert a few numbers and/or special characters in
place of letters and youll have a decent password.
86 Chapter 3:System Configuration
Press the Accept button again when finished. The system will let you knowif it thinks
the password is easy to crack; if you get a warning message, dont use the password.
3.1.6 Modifying a User Account
Go to Config => Users accounts => Normal => User accounts, use the filter if nec-
essary, and then select the account that you wish to modify.
See Section 3.1.5, Adding a User Account if you need guidance for how to fill in
the user accounts fields.
To implement the changes select Accept. If you decide against making any changes
select Cancel. This guarantees that no changes are made.
3.1.7 Changing a Users Password
Open Config => Users accounts => Normal => User accounts. This will open the
Users accounts tab (see Figure 33, Users Accounts Screen).
You may see a filter screen, depending upon the settings youve provided on
Control => Features. If you want the full list, select Accept without changing
any of the parameters. For detailed information on the various filters, select the
Help button on the Filter control screen.
Select the account whose password you wish to change. This will open the User
information tab.
Select Passwd from the options at the bottom of the screen.
Linuxconf will prompt you to enter the newpassword. There is also a field called Con-
firmation where you will need to type the password again. This is to prevent you
from mistyping the password. See Section 3.1.5, Adding a User Account for guid-
ance on choosing a password. If you decide against changing the password, select
Cancel. Once you have entered the new password select Accept.
3.1.8 Changing the Root Password
Because of the security implications of root access, linuxconf requires you to verify that
you currently have access to the root account.
Open Config => Users accounts => Normal => Change root password.
Section 3.1:System Configuration with linuxconf 87
Figure 36 Root Password Verification Screen
Youll first need to enter the current root password to verify access to the root account.
Once you have entered roots current password, it will prompt you for a new pass-
word. In the Confirmation field, type the password again (see Figure 35, Change
Password Screen). This is to prevent you from mistyping the password. See Section
3.1.5, Adding a User Account if you need guidance on choosing a password. Be sure
to choose a good password! If you decide against changing the root password, just
select Cancel. Once you have entered the new password select Accept.
3.1.9 Disabling a User Account
Disabling a users account is preferable to deleting a users account, unless you need
the storage space or youre certain that his/her data will not be needed in the future.
If a users account is disabled, they will not be allowed to log in.
Open Config => Users accounts => Normal => User accounts.
88 Chapter 3:System Configuration
De-select the check-box that states that The account is enabled. Select
the Accept button at the bottom of the window and youre all set.
The account is disabled and can be enabled later using a similar method.
3.1.10 Enabling a User Account
By default, all newly created user accounts are enabled. If you need to enable an
account, you can use linuxconf to do it.
Open Config => Users accounts => Normal => User accounts. Select the The account
is enabled checkbox.
3.1.11 Deleting a User Account
Please Note
While there are options for retaining files associated with an
account, any files that are deleted are gone and effectively
unrecoverable. Take care when using this option!
To delete an account:
Open Config => Users accounts => User accounts.
On the User accounts screen (see Figure 33, Users Accounts Screen) select the
account you wish to delete.
At the bottom of the User information screen, select Del to delete the account.
Linuxconf will then prompt you with a list of options.
Section 3.1:System Configuration with linuxconf 89
Figure 37 Deleting Account Screen
The default option is to archive the accounts data. The archive option has the fol-
lowing effects:
1. Removes the user from the user accounts list;
2. Takes everything contained in the users home directory and archives it (using tar
and gzip compression), storing the resulting file in the /default_home_di-
rectory/oldaccounts directory. For an account named useraccount
the filename would be similar to:
useraccount-2000-01-10-497.tar.gz
The date indicates when the account was deleted, and the number following it is
the ID of the process that actually performed the deletion. The oldaccounts
directory is created in the same place as all of your user directories, and is created
automatically the first time you remove a user account using this option.
3. Files not contained in the users home directory, but owned by that user remain.
The file is owned by the deleted accounts user ID (UID). If you create a new
90 Chapter 3:System Configuration
account and specifically assign it the UIDof a deleted account, it will then become
the owner of any remaining files.
Selecting Delete the accounts data on the Deleting account <accountname> screen (see
Figure 37, Deleting Account Screen) will:
1. Remove the user from the user accounts list;
2. Remove the users home directory and all its contents.
Please Note
Files not contained in the users home directory, but owned
by that user will remain on the system. The file will still
be owned by the deleted accounts user ID (UID). If you
create a new account and specifically assign it the UID of a
deleted account, it will then become the owner of any such
"orphaned" files.
Selecting Leave the accounts data in place on the Deleting account <accountname> screen
(see Figure 37, Deleting Account Screen) will:
1. Remove the user from the user accounts list;
2. Leave the users home directory (with all its files) in place.
Please Note
Files and directories owned by the deleted accounts user
ID (UID) will remain on the system. If you create a new
account and specifically assign it the UID of a deleted ac-
count, it will then become the owner of these "orphaned"
files.
Section 3.1:System Configuration with linuxconf 91
3.1.12 Groups
All users belong to one or more groups. Just as each file has a specific owner, each
file belongs to a particular group as well. The group might be specific to the owner of
the file, or may be a group shared by all users. The ability to read, write or execute a
file can be assigned to a group; this is separate from the owners rights. For example,
the owner of a file will be able to write to a document, while other group members
may only be able to read it.
Creating a Group
To create a new group:
Open Config => Users accounts => Normal => Group definition.
You may see a filter screen, depending upon the settings in Control => Filters. Either
provide a filter, or select Accept to bypass the filter.
Figure 38 User Groups Screen
Select Add at the bottom of the User groups screen.
92 Chapter 3:System Configuration
Figure 39 Group Specification Screen
Enter a group name. You may also wish to specify members of the group and can do
so in the Alternate members field. The list of users should be space delimited, meaning
that each username must have a space between it and the next one. Leave the Group
name field blank, so that the system will assign a Group ID (GID) to your new group.
When youre finished, select Accept and the group will be created.
Deleting a Group
To delete a group:
Open Config => Users accounts => Normal => Group definitions.
You may see a filter screen, depending upon the filter setting in Control => Features.
You can use the filter to narrow your choice of groups by specifying a prefix.
With or without a prefix select Accept at the bottom of the screen.
On the User groups screen (see Figure 38, User Groups Screen) select the group
you wish to delete.
Section 3.1:System Configuration with linuxconf 93
Youll be presented with the Group specification screen (see Figure 39, Group
Specification Screen).
Select Del to delete the group. Linuxconf will then prompt you to confirm the
deletion. Choose yes to delete the group.
The groups files will still remain and their respective owners will still have sole
control over them. The group name will be replaced with the deleted groups ID.
The files may be assigned to a new group by using the chgrp command. More
information on chgrp can be found by typing the command info chgrp or man
chgrp at the shell prompt. If a new group is created and the deleted groups ID
is specified then the new group will have access to the deleted groups files. Dont
worry, linuxconf doesnt recycle old group numbers any more than it does old user IDs,
so it wont happen by accident.
Modifying Group Membership
There are two ways to modify the list of users that belong to a group. You can either
update each user account itself, or you can update the group definitions. In gen-
eral, the fastest way is to update each of the group definitions. If youre planning on
changing more information for each user than just the group information, then updat-
ing each user account may prove easier.
Well start by detailing the group definitions method.
Start linuxconf by typing linuxconf at the shell prompt.
Open Config => Users accounts => Normal => Group definitions.
Depending on the filter settings in Control => Features, you may see a filter screen.
Use the filter to narrow the list, or just select Accept to bypass the filter.
Select the group you wish to modify. This will open the Group specifica-
tion screen (see Figure 39, Group Specification Screen).
Add or remove each user from the Alternate members field. Make sure that all of
the user names are separated by a space character.
Select Accept, which can be found at the bottom of the screen.
94 Chapter 3:System Configuration
This will automatically update each user account with the group showing up in the
Supplementary groups field if added or absent if removed.
Adding and removing groups can also be done by modifying each individual user
account.
Start linuxconf by typing linuxconf at the shell prompt.
Open Config => Users accounts => Normal => User accounts.
You may see a filter screen, depending on the settings in Control => Features. Use
the filter to narrow the list or select Accept to bypass the filter.
On the User accounts screen (see Figure 33, Users Accounts Screen), select a user
that you wish to update. You will be presented with the User information screen.
Add or remove the desired groups from the Supplementary groups field. Each
group should be separated by a space character.
Once youve made all the changes youd like, select Accept at the bottom of
the screen.
This will automatically update the group definitions. Repeat the process for each
user.
3.1.13 Filesystems
A filesystem is composed of files and directories, all starting from a single root di-
rectory. The root directory may contain any number of files and other directories,
with each directory in turn following suit. The average filesystem often looks like
an inverted tree with the directories as branches and the files as leaves. Filesystems
reside on mass storage devices such as diskette drives, hard drives, and CD-ROMs.
For example, a diskette drive on DOS and Windows machines is typically referenced
by A:\. This describes both the device (A:), and the root directory on that device
(\). The primary hard drive on the same systems is typically referred to as the "C"
drive because the device specification for the first hard drive is C:. To specify the
root directory on the C drive, you would use C:\.
Under this arrangement, there are two filesystems -- the one on A:, and the one on C:.
In order to specify any file on a DOS/Windows filesystem, you must either explicitly
Section 3.1:System Configuration with linuxconf 95
specify the device on which the file resides, or it must be on the systems default drive
(which is where DOS C prompt comes from -- thats the default drive in a system
with a single hard drive).
Under Linux, it is possible to link the filesystems on several mass storage devices to-
gether into a single, larger, filesystem. This is done by placing one devices filesystem
"under" a directory on another devices filesystem. So while the root directory of a
diskette drive on a DOS machine may be referred to as A:\, the same drive on a
Linux system may be accessible as /mnt/floppy.
The process of merging filesystems in this way is known as mounting. When a de-
vice is mounted, it is then accessible to the systems users. The directory "under"
which a mounted devices filesystem becomes accessible is known as the mount
point. In the previous paragraphs example, /mnt/floppy was the diskette drives
mount point. Note that there are no restrictions (other than common conventions) as
to the naming of mount points. We could have just as easily mounted the floppy to
/long/path/to/the/floppy/drive.
One thing to keep in mind is that all of a devices files and directories are relative to
its mount point. Consider the following example:
A Linux System:
/ -- system root directory
/foo -- mount point for the CD-ROM
A CD-ROM:
/ -- CD-ROMs root directory
/images -- A directory of images on the CD-ROM
/images/old -- A directory of old images
So, if the above describes the individual filesystems, and you mount the CD-ROM at
/foo, the new operating system directory structure would be:
96 Chapter 3:System Configuration
A Linux System (with the CD-ROM mounted):
/ -- System root directory
/foo -- CD-ROM root directory
/foo/images -- A directory of images on the CD-ROM
/foo/images/old -- A directory of old images
To mount a filesystem make sure to be logged in as root, or become root using the su
command. For the latter, type su at the shell prompt and then enter the root password.
Once you are root, type mount followed by the device and then the mount point. For
example, to mount the first diskette drive on /mnt/floppy, you would type the
command mount /dev/fd0 /mnt/floppy.
At installation, Red Hat Linux will create /etc/fstab. This file contains infor-
mation on devices and associated mount points. The advantage to this file is that it
allows you to shorten your mount commands and it controls which filesystems are
automatically mounted when the system is booted.
Using the information in /etc/fstab, you can type mount and then either the
mount point or the device. The mount command will look for the rest of the in-
formation in /etc/fstab. Its possible to modify this file by hand, or by using
linuxconf.
Reviewing Your Current Filesystem
Well start by looking at your current directory structure.
Open Config => File systems => Access local drive.
Section 3.1:System Configuration with linuxconf 97
Figure 310 Local Volume Screen
The fields, as shown in Figure 310, Local Volume Screen, are:
Source: The physical hardware; hd indicates an IDE hard drive, fd indicates a
diskette drive, and cdrom typically indicates a CD-ROM drive. If your system
has a SCSI drive, you will see an sd instead. More than one drive of a type are
listed by letters, so hda represents the first IDE drive, while hdb would be the
second. In some cases, youll see numbers following these letters; on hard drives,
the numbers represent the partitions on that drive, while for diskette drives, this
number refers to the actual unit.
Mount point: This is where in the system the drive is accessible from when
mounted.
FsType: The type of filesystem. A standard Linux partition uses the ext2 filesys-
temtype. Afilesystemtype of vfat indicates a DOS filesystemwith long filename
support, while a fat filesystem type is for DOS filesystems supporting traditional
8.3 filenames. The iso9660 filesystem type indicates a CD-ROM drive.
98 Chapter 3:System Configuration
Please Note
Red Hat Linux 6.2 can access FAT32 filesystems using
the vfat filesystem type.
Size: Size may indicate the size of the filesystem in megabytes (M), or it may not
be filled in.
Partition type: A description of the filesystem used on that partition (may not be
filled in).
Status: Whether the device is mounted or not.
Filesystems from other machines on a network may also be available. These can
range from single small directories to entire volumes. No information on Size or
Partition type is available for these partitions, either. Additional information on NFS
filesystems (should you have any available) will be contained under:
Config => File systems => Access nfs volume
Section 3.1:System Configuration with linuxconf 99
Figure 311 NFS Volume Screen
The screen (see Figure 311, NFS Volume Screen is similar to the Local volume screen,
with some notable differences in the information provided for each entry:
Source: This will be the name of the machine serving the filesystem, followed
by the remote directory. For example: foo:/var/spool/mail where foo
is the machine serving the directory, and /var/spool/mail is the directory
being served.
FsType -- This will always be "nfs."
Adding NFS Mounts
NFS (Network File System) is a way for computers to share sections of their local
filesystem across a network. These sections may be as small as a single directory,
or include thousands of files in a vast hierarchy of directories. For example, many
companies will have a single mail server with individuals mail files served as an NFS
mount to each users local systems.
To add an NFS mount:
100 Chapter 3:System Configuration
Open Config => File systems => Access nfs volume.
On the NFS volume screen, select Add.
Figure 312 Volume Specification Screen
The three fields on the Base tab are what youll need to concern yourself with next
(see Figure 312, Volume Specification Screen).
Server: The host name of the machine the desired filesystem resides on. For
example, foo.bar.com.
Volume: The filesystem you wish to add. For example, /var/spool/mail.
Mount point: Where in your system you want the remote file system accessible
from. For example, /mnt/mail.
This is all you need to get the mount created. Linuxconf will update your /etc/fstab
file accordingly. If you are aware of additional requirements, please read the help file
on the Volume specification screen and see the mount man page for more information.
Once you have entered the information, select Accept.
Section 3.1:System Configuration with linuxconf 101
3.1.14 Getting Connected with Linuxconf (Network
Configuration)
The first thing to determine when getting hooked up is whether youre connecting to a
local area network, such as a group of computers in an office, or a wide area network,
such as the Internet. Before continuing, its important to know what hardware you
have and how you intend to connect. If youre going to dial into another computer,
then make sure your modem is installed and that the cables are arranged properly.
If youre using a network card, make sure it is installed properly and that the cables
are correctly connected. Regardless of what network configuration you specify, if
every phone line or cable is not in place, youll never get connected. Well start with
modem connections and then move on to using network cards.
Adding Modem/PPP/SLIP connections
Red Hat Linux 6.2 uses the utility called RP3, or the RH PPP Dialer, a graphical tool
which helps users configure and monitor network accounts -- particularly PPP ac-
counts. (To read more about RP3, see the related chapter in the Official Red Hat
Linux Getting Started Guide.) However, you can still depend on linuxconf to set up
network configuration.
There are several pieces of information you will need to get from your ISP (Internet
Service Provider) or systems administrator before getting your PPP or SLIP account
working. In the case of some providers, you may have to sort through directions on
how to set up a PPP connection on a Linux system. Some ISPs are ill-equipped to
handle individuals using Linux. Dont worry, you can still get connected; you just
need some additional information from your ISP.
The following is what you need for a connection with Red Hat Linux. The ISP repre-
sentatives may respond that you dont need this information, or may suggest that you
need more than this. Red Hat has streamlined the information needed using intelli-
gent defaults and tools such as linuxconf to simplify this process for you. Unless they
have a document specifically for Red Hat Linux, just request the information below
and go from there. Specifically, youll need:
The IP address for the ISPs domain name server
The telephone number to dial
102 Chapter 3:System Configuration
Your login and password
An IP address for your machine if the network you are connecting to isnt going
to provide you with a dynamic one
Information about whether your ISP uses an authentication method such as PAP,
CHAP or MS-CHAP. If so, you will need a "secret" to enable authentication. The
secret will be a word or sequence of characters. CHAP and MS-CHAP are not
currently supported using linuxconf, and are rarely used.
Additional information which may be helpful, but isnt necessary includes a sec-
ondary name server address, and a search domain. Once you have all this informa-
tion, youre ready to get connected.
Open Config => Networking => Client tasks => PPP/SLIP/PLIP.
Select Add.
Figure 313 PPP/SLIP/PLIP Configurations Screen
Initially there wont be any configurations specified. When you select Add you will
be given a choice between PPP, SLIP and PLIP.
Section 3.1:System Configuration with linuxconf 103
Figure 314 Type of Interface Screen
PPP is the most commonly used interface and is the default. To set up a PPP connec-
tion select PPP and select Accept.
104 Chapter 3:System Configuration
Figure 315 PPP Interface Screen
Youll see the following fields:
Phone number -- The number your modem will need to dial to access your ISP or
the remote system
Modem port -- Indicates where your modem is and should already be set
Use PAP authentication check box -- Check if you know that the system you are
dialing into requires this
Login name -- Your login name for the PPP account
Password -- Your password for the PPP account
Notice that the title bar is PPP interface ppp0. ppp0 is the first PPP interface, ppp1
would be the second and so on. Its important to keep track of which interface youre
using if you have more than one. SLIP connections use sl instead of ppp for their
interface prefix. With the exception of a PAP authentication option, the entry screens
for adding a PPP or a SLIP account are identical.
Section 3.1:System Configuration with linuxconf 105
Enter the complete phone number for the remote machine, and make sure to include
any numbers required to access outside lines.
For example, if you need to dial 9 and then the number, and the computer youre
connecting to has a telephone number of 555-0111, then youd enter 95550111.
The next information youre asked for is the modem port. This is a drop down box
of available ports. If youre using a dual-boot Linux/Windows system and you know
the COM port your modem is on, the following map may be of use:
Map to Windows COM ports are as follows:
ttyS0 -- COM1: under MS-DOS;
ttyS1 -- COM2: under MS-DOS;
ttyS2 -- COM3: under MS-DOS;
ttyS3 -- COM4: under MS-DOS.
The login name is the one for the PPP account. The password you enter will be shown
in plain text, so be careful who you have around when you enter it! If you will be
using PAP authentication, check the box; when youve entered the other required
information, select the Customize button at the bottom of the screen.
If youre using PAP, select the PAP tab and enter your username and then the secret
the ISP has provided you in the Secret field. The other defaults should be sufficient,
but if you need to, you can edit the initial settings using the Customize option.
Modifying a PPP or SLIP Configuration
You can edit an existing configuration as well as delete it by selecting it from the list
on the PPP/SLIP/PLIP configurations screen.
Open Config => Networking => Client tasks => PPP/SLIP/PLIP.
You will then be presented with the PPP/SLIP/PLIP configurations
screen (see Figure 313, PPP/SLIP/PLIP Configurations Screen). Select the con-
figuration you would like to modify or delete.
This will open the appropriate interface screen for your configuration. If you wish
to delete the configuration, select Del at the bottom of the screen. The Modem
port is on the Hardware tab and is a drop down menu. If you want to change the
106 Chapter 3:System Configuration
other settings you entered when you originally created the configuration, select
the Communication tab. The first Send field contains your login, and the next Send
field contains your password. The Expect fields correspond to the login: and
password: prompts, which explains the ogin: and ord: entries.
Please Note
The ogin: and ord: entries may not be the same for
your system. Different ISP/PPP servers may use differ-
ent text and should be changed to fit the needs of what-
ever server type you are logging in to. Instead, you may
see such prompts as User ID and authentifica-
tion.
Figure 316 PPP Customization The Communication Tab
Section 3.1:System Configuration with linuxconf 107
Once you have made your changes, you can test to see if your configuration is work-
ing. Select Connect from the bottom of the screen. This will attempt to connect
you to the remote system using the information youve entered.
Other Network Connections
Setting up a network connection over Ethernet requires an entirely different type of
setup. Network connections to Token Ring or ARCnet networks follow a similar
procedure, but will not be discussed here.
First you will need to have an Ethernet card installed.
Start linuxconf by typing linuxconf at the shell prompt.
Open Config => Networking => Client tasks => Basic host information. The Host
name tab will request a host name, which should be specified by default unless
you did not setup your networking during the installation process. If it is not
already specified, please take the time now to configure it. It should be specified
as localhost.localdomain. Skip this tab. Select the tab for Adaptor 1.
Figure 317 Adaptor 1
108 Chapter 3:System Configuration
The first item on this screen is a check box to indicate whether this adaptor is enabled
or not. It should be checked if this is the one you intend to use. Below that is a
choice of Config modes. Manual means that you will be providing all the information
and entering it yourself. Dhcp and Bootp mean that your machine will be getting its
network configuration information from a remote DHCP or BOOTP server. If youre
not sure what option to choose, talk to your network administrator.
Required fields for DHCP or BOOTP:
Net device -- The type of network card you are using; for example, eth0 would be
the appropriate entry to use the first Ethernet card.
Kernel module -- The correct module based on your network card; for further
information see the list below.
For DHCP and bootp configurations you only need to specify the Net device and the
Kernel module. For the Net device, you will choose from a list where the eth prefix
represents Ethernet cards, arc specifies an ARCnet card and tr specifies Token Ring
cards. A complete list of network cards and their respective modules can be found in
Appendix A, General Parameters and Modules. For the most up-to-date list, please
see our website at:
http://www.redhat.com/support/hardware
The netmask information may be set by default, although depending on what kind
of network you are setting up, or becoming a part of, you may need to specify this.
If you are connecting to an ISP, ask them for the information. Most likely it will be
255.255.255.0.
Required fields for manual configuration:
Primary name + domain -- The primary name is the name of your computer, while
the domain is howyour network is specified. For example, foo.bar.com; foo
is the primary name and bar.com is the domain.
IP address -- The address of the machine and will follow the pattern of x.x .x.x.
For example, 192.168.0.13.
Net device -- The type of network card you are using; eth0 would be the appropriate
entry to use the first Ethernet card.
Section 3.1:System Configuration with linuxconf 109
Kernel module -- The correct module based on your network card.
Information on net devices and kernel modules is described above. The appropriate
primary name + domain and IP address will depend on whether you are adding the
computer to an existing network or creating a new network. For connecting to an
existing network, contact your network administrator for the information. Getting a
network connected to the Internet is beyond the scope of this book, and we recom-
mend the following starting point:
TCP/IP Network Administration, 2nd Edition, by Craig Hunt (OReilly and Asso-
ciates).
If youre setting up a private network that wont ever be connected to the Internet,
then you can choose any primary name + domain name you would like and have
several choices for IP addresses (See Table 31, Addresses and Examples).
Table 31 Addresses and Examples
Addresses available Examples
10.0.0.0 - 10.255.255.255 10.5.12.14
172.16.0.0 - 172.31.255.255 172.16.9.1, 172.28.2.5
192.168.0.0 - 192.168.255.25 192.168.0.13
The three sets of numbers above correspond to class a, b, and c networks respectively.
The classes are used to describe the number of IP addresses available as well as the
range of numbers. The numbers above have been set aside for private networks.
Please Note
You should not use these IP addresses if you connect to the
Internet since 192.168.0.* and 192.168.255.* are not reli-
ably considered private. If you want your network to be
connected to the Internet, or think you might want to at
some point in the future, do yourself a favor and get your-
self non-private addresses now.
110 Chapter 3:System Configuration
Name Server Specification
A name server and default domain are also needed to establish a network connection.
The name server is used to translate host names such as private.network.com
to their corresponding IP address such as 192.168.7.3.
The default domain tells the computer where to look if a fully qualified hostname isnt
specified. Fully qualified means that the full address is given, so foo.redhat.com
is the fully qualified hostname, while the hostname is simply foo. If you specified
your default domain as redhat.com, then you could use just the hostname to con-
nect successfully. For example ftp foo would be sufficient if your search domain
is redhat.com, while ftp foo.redhat.com would be required if it wasnt.
To specify the nameserver, open Config => Networking => Client tasks => Name server
specification (DNS).
Figure 318 Resolver Configuration Screen
Nameservers are ranked according to the order in which they are accessed, so its
not unusual to see nameservers referred to as primary, secondary, tertiary and so on
Section 3.1:System Configuration with linuxconf 111
down the list if more than one is specified. Each of these must be an IP address and
not a name, since the computer has no way to resolve the name until it connects to a
nameserver.
In addition to a default domain, you can also specify search domains. Search domains
work differently; they progress from one to six in a similar manner to the nameserver.
However, they all take precedence over the default domain! Keep this in mind when
specifying search domains. Search domains are not commonly used.
The one item not yet covered is the check box for DNS usage. If you are running
a small private network with no Internet connection, then using /etc/hosts files
and keeping them all synchronized will work. As you add more and more machines,
the complexity increases until it is easier to have a single machine run a DNS than to
continue to sync /etc/hosts files.
Another reason for not using DNS is if your network is going to use NIS instead. Note
that NIS can be used in conjunction with DNS. So to sum it all up, unless you know
why using /etc/hosts or NIS would be best for your situation, DNS is probably
going to be your best choice.
You can add, modify, or delete entries from the /etc/hosts file using linuxconf.
Open Config => Networking => Misc => Information about other hosts.
112 Chapter 3:System Configuration
Figure 319 /etc/hosts Screen
To modify or delete an entry select it. To delete the entry, select Del at the bottom of
the host/network definition screen.
Section 3.1:System Configuration with linuxconf 113
Figure 320 Host/Network Definition Screen
To modify it, change the information as necessary. To add a new entry, select Add
at the bottom of the /etc/hosts screen. This will also open the host/network definition
screen.
Required Fields:
Primary name + domain -- The primary name is the name of the computer, while
the domain is how the network it is attached to is specified. For example, given
foo.bar.com, foo is the primary name and bar.com is the domain.
IP number -- Also referred to as IP address; this is the address of the machine and
will follow the pattern of x.x. x.x. For example, 192.168.0.13.
Optional Fields:
Aliases -- A shorthand for the fully qualified domain name. This is often the
same as the primary name. So, for example, if the fully qualified domain name
is foo.bar.com, you could select foo as the alias.
114 Chapter 3:System Configuration
Comment -- A comment on the machine. For example, "The remote nameserver."
Once finished, select Accept.
3.1.15 Finding Your Way Through linuxconf
This table provides a quick reference for this chapter. Unfortunately, it doesnt pro-
vide a complete quick reference for linuxconf, which has many more capabilities than
this documentation provides.
Table 32 Linuxconf Quick Reference
What do you want to do? Where to find it in linuxconf
Add/modify/disable/delete a user
account
Config => Users accounts => Normal
=> User accounts
Change a users password Config => Users accounts => Normal
=> User accounts
Change the root password Config => Users accounts => Normal
=> Change root password
Configure networking Config => Networking => Client tasks
=> Basic host information
Create/delete a group Config => Users accounts => Normal
=> Group definitions
Create/modify modem/PPP/SLIP
connections
Config => Networking => Client tasks
=> PPP/SLIP/PLIP
Edit parameters for passwords Users Accounts => Password &
Account Policies
Disable tree menu Control => Control files and systems =>
Configure linuxconf modules
Enable Web-based access to linuxconf Config => Networking => Misc =>
Linuxconf network access
Section 3.2:System Configuration with the Control Panel 115
What do you want to do? Where to find it in linuxconf
Modify /etc/hosts Config => Networking => Misc =>
Information about other hosts
Modify group membership Config => Users accounts => Normal
=> Group definitions or Config => Users
accounts => Normal => User accounts
Set filter parameters Control => Features
Specify a nameserver (DNS) Config => Networking => Client tasks =>
Name server specification (DNS)
View filesystem Config => File systems => Access
local drive or Config => File systems
=> Access nfs volume
3.2 System Configuration with the Control Panel
Please Note
Most of what can be done with the control panel applica-
tions can also be done using linuxconf. In addition, linuxconf
supports both character-cell and graphical user interfaces.
Please refer to Section 3.1, System Configuration with linux-
conf for an introduction to linuxconf.
The control panel is a launching pad for a number of different system administra-
tion tools (see Figure 321, The Control Panel). These tools make your life easier
by letting you configure things without remembering configuration file formats and
awkward command line options.
116 Chapter 3:System Configuration
Figure 321 The Control Panel
To start the control-panel, start the X Window System as root with startx and type
control-panel in an Xterm. You will need to be root to run the control-panel
tools successfully. You can do this as well if you already have X running as a normal
user. Just type su -c control-panel and then type the root password when
prompted. If you plan to do other tasks as root, you could type su followed by the
root password when prompted.
Please Note
If you are not running X as root, you may need to give root
access to your systems X server. To do this, enter the fol-
lowing command on a non-root terminal window:
xhost +localhost
After starting the control panel, simply clicking on an icon starts up a tool. Please
note that you are not prevented from starting two instances of any tool, but doing so
is a very bad idea because you may try to edit the same files in two places and end
up overwriting your own changes.
Section 3.2:System Configuration with the Control Panel 117
Please Note
If you do accidentally start a second copy of a tool, you
should quit it immediately. Also, do not manually edit any
files managed by the control-panel tools while the tools are
running. Similarly, do not run any other programs (such
as linuxconf) that may change those files while the tools are
running.
3.2.1 Printer Configuration
Please note that the Official Red Hat Linux Getting Started Guide contains more
up-to-date documentation on printtool, so be sure to check that document before us-
ing printtool.
The printer configuration tool (printtool) maintains the /etc/printcap file, print
spool directories, and print filters. The filters allow you to print many different types
of files, including:
plain text (ASCII) files
PostScript files
TeX .dvi files
GIF, JPEG, TIFF, and other graphics formats
RPMs
In other words, simply printing a GIF or RPMfile using the lpr command will result
in the printer doing "the right thing."
118 Chapter 3:System Configuration
Figure 322 Print Tool
In order to create a new print queue, choose Add. Then, select what type of printer
is being added. There are four types of print queues which can be configured with
printtool:
Local print queues are for printers attached to a printer or serial port on your Red
Hat Linux system
Remote print queues are attached to a different systemwhich you can access over
a TCP/IP network
SMB print queues are attached to a different system which uses LAN-Manager-
type (SMB) networking
NCP print queues are attached to a different systemwhich uses Novells NetWare
network technology
Section 3.2:System Configuration with the Control Panel 119
Figure 323 Selecting a Printer Type
After choosing the printer type, a dialog box requests further information about the
print queue (see Figure 324, Adding a Local Printer). All types of print queues
require the following information:
Queue Name -- What the queue will be called. Multiple names can be specifed
with the | (pipe) character separating entries.
Spool Directory -- This is the directory on the local machine where files are stored
before printing occurs. Be careful to not have more than one printer queue use a
given spool directory.
File Limit -- Maximum size print job accepted, in kilobytes (1 kb = 1024 bytes).
A size of 0 indicates no limit should be imposed.
Input Filter -- Filters convert printed files into a format the printer can handle.
Press Select to choose the filter which best matches your printer (see Figure
325, Configuring a Print Filter).
In addition to configuring print queues able to print graphical and PostScript out-
put, you can configure a text-only printer, which will only print plain ASCII text.
Most printer drivers are also able to print ASCII text without converting it to
PostScript first; simply choose Fast text printing when you configure
the filter.
120 Chapter 3:System Configuration
Please Note
This only works for non-PostScript printers.
Suppress Headers -- Check this if you dont want a header page printed at the
beginning of each print job.
For local printers, the following information is also required:
Printer Device -- Usually /dev/lp1; the name of the port which the printer is
attached to. Serial printers are usually on /dev/ttyS? ports. Note that you
will need to manually configure serial parameters.
Figure 324 Adding a Local Printer
Section 3.2:System Configuration with the Control Panel 121
Figure 325 Configuring a Print Filter
For remote printers, the dialog box contains additional fields; fill in the following
information:
Remote Host -- Hostname of the remote machine hosting the printer.
Remote Queue -- Name of the queue to print to on the remote machine.
The remote machine must be configured to allow the local machine to print on the
desired queue. Typically /etc/hosts.lpd controls this.
122 Chapter 3:System Configuration
Figure 326 Adding a Remote Printer
Figure 327 Adding an NCP Printer
Section 3.2:System Configuration with the Control Panel 123
Figure 328 Adding an SMB Printer
For SMB and NCP printers, fill in the following information:
Hostname of Printer Server -- Name of the machine to which the printer you want
to use is attached.
IP number of Server -- The IP address of the machine to which the printer you
want to use is attached; this is optional and only relevant for SMB printers.
Printer Name -- Name of the printer on which you want to print.
User -- Name of user you must login as to access the printer (typically guest
for Windows servers, or nobody for samba servers).
Password -- Password (if required) to use the printer (typically blank). Someone
should be able to tell you this if you do not already know it.
124 Chapter 3:System Configuration
Please Note
If you require a username and password for an SMB (LAN
Manager) or NCP (NetWare) print queue, they are stored
unencrypted in a local script. Thus, it is possible for another
person to learn the username and password. It is therefore
recommended that the username and password for use of the
printer to be different than that for a user account on the local
Red Hat Linux system, so that the only possible security
compromise would be unauthorized use of the printer. If
there are file shares fromthe SMBserver, it is recommended
that they also use a different password than the one for the
print queue.
After you have added your print queue, you may need to restart the printer daemon
(lpd). To do so, choose Restart lpd from the lpd menu.
You may print a test page for any print queue you have configured. Select the type
of test page you would like to print from the Tests menu.
Figure 329 Printing a Test Page
3.2.2 Loading Kernel Modules
The Linux kernel has a modular design. At boot time, only a minimal resident kernel
is loaded into memory. Thereafter, whenever a user requests a feature that is not
present in the resident kernel, a kernel module is dynamically loaded into memory.
After a specified period of inactivity, the module may be removed frommemory. This
design promotes leanness and efficiency.
Section 3.2:System Configuration with the Control Panel 125
The mechanism that supports dynamic loading of modules is a kernel thread called
kmod. When the kernel requests a module, kmod wakes up and calls modprobe(8)
to get it.
When you install Red Hat Linux, the hardware on your system is probed and you
provide information about howthe system will be typically used and which programs
should be loaded. Based on this probing and the provided usage information, the
installation program decides which features to compile into the resident kernel and
which to put in loadable modules, and sets up the dynamic loading mechanism to
work transparently. But this is a highly configurable procedure. If you build your
own custom kernel, you can make all of these decisions for yourself.
If you add newhardware after installation requiring support provided in a kernel mod-
ule, you need to set up the dynamic loading mechanism. You do this by editing the
module configuration file, /etc/conf.modules.
For example, if at the time you installed Red Hat Linux your system included a model
SMC EtherPower 10 PCI network adapter, the module configuration file will contain
this line: alias eth0 tulip. If, after installation, you install a second identical
network adapter to your system, add this line to /etc/conf.modules:alias
eth1 tulip.
See Appendix A, General Parameters and Modules for an alphabetical list of kernel
modules and the hardware the modules support.
3.2.3 Network Configuration
Please Note
Documentation on network configuration using linuxconf can
be found in Section 3.1.14, Getting Connected with Linuxconf
(Network Configuration).
The network configuration tool (netcfg) shown in Figure 330, Network Configu-
ration Panel is designed to alloweasy manipulation of parameters such as IP address,
gateway address, and network address, as well as name servers and /etc/hosts.
126 Chapter 3:System Configuration
Figure 330 Network Configuration Panel
Network devices can be added, removed, configured, activated, deactivated and
aliased. Ethernet, arcnet, token ring, pocket (ATP), PPP, SLIP, PLIP and loopback
devices are supported. PPP/SLIP/PLIP support works well on most hardware, but
some hardware setups may exhibit unpredictable behavior. When using the Network
Configuration Tool click Save to write your changes to disk, to quit without making
any changes select Quit.
Managing Names
The Names panel of the Network Configuration tool serves two primary purposes:
setting the hostname and domain of the computer, and determining which name server
will be used to look up other hosts on the network. The Network tool is not capable of
configuring a machine as a nameserver. To edit a field or add information to a field,
simply click on the field with the left mouse button and type the new information.
Section 3.2:System Configuration with the Control Panel 127
Figure 331 Adding/Editing Hosts
Managing Hosts
In the Hosts management panel you have the ability to add, edit, or remove hosts
from the /etc/hosts file. Adding or editing an entry involves identical actions.
An edit dialog box will appear, simply type the new information and click Done
when you are finished. See Figure 331, Adding/Editing Hosts for an example.
Adding a Networking Interface
If you have added a networking interface to your machine since installing Red Hat
Linux, or you didnt configure your Ethernet card at install time, you can configure
it with a few clicks of a mouse.
128 Chapter 3:System Configuration
Please Note
You may need to configure kerneldto load a driver for the
network interface you are adding (e.g., eth0); see Section
3.2.2, Loading Kernel Modules for more information.
Begin adding an interface by clicking on Interfaces in the main panel. This will
bring up a window of configured devices with a row of available options, see Figure
332, Configured Interfaces.
Figure 332 Configured Interfaces
To add a device, first click the Add button then select the type of interface you want
to configure from the box that appears (See Figure 333, Choose Interface Type).
Section 3.2:System Configuration with the Control Panel 129
Figure 333 Choose Interface Type
Please Note
There is now a clone button available in netcfg. This
button can be used to create a "clone" of an already-existing
interface. By using clone interfaces, it is possible for a lap-
top to have one Ethernet interface defined for a work LAN,
and a clone Ethernet device defined for a home LAN.
PPP Interface
Adding a PPP interface can be as simple as supplying the phone number, login name
and password in the Create PPP Interface dialog shown in Figure 334, Cre-
ate PPP Interface. If you must use PAP authentication for your PPP connection,
choose Use PAP authentication. In many cases some degree of customiza-
tion will be needed to establish a PPP connection. Choosing the Customize button
will allow you to make changes to the hardware, communication, and networking
settings for the PPP interface.
130 Chapter 3:System Configuration
Figure 334 Create PPP Interface
SLIP Interface
In order to configure a SLIP interface you must first supply a phone number, login
name, and password. This will supply the initial parameters for the chat script needed
to establish a SLIP connection. When you choose Done, a dialog titled Edit SLIP
Interface appears that enables you to further customize the hardware, communi-
cation and networking parameters for your SLIP interface.
PLIP Interface
To add a PLIP interface to your system you only have to supply the IP address, the
remote IP address, and the Netmask. You can also select if you want to activate the
interface at boot time.
Ethernet, Arcnet, Token Ring and Pocket Adaptor Interfaces
If you are adding an ethernet, arcnet, token ring or pocket adapter to your computer
you will need to supply the following information:
Device -- This is determined by netconfig based on the devices already config-
ured.
IP Address -- Enter an IP address for your network device.
Netmask -- Enter the network mask for your network device.
Section 3.2:System Configuration with the Control Panel 131
The network and broadcast addresses are calculated automatically based on the
IP address and netmask you enter.
Activate interface at boot time:
If you want the device to be configured automatically when your machine boots
select this by clicking on the box.
Allow any user to (de)activate interface:
Check this if you want any user to be able to activate or deactivate the interface.
Interface configuration protocol:
If you have a BOOTP or DHCP server on your network and would like to use it to
configure the interface, choose the appropriate option; otherwise, choose none.
After providing the configuration information for your new device, click Done. The
device should appear in your Interfaces list as an inactive device. (The active
column should have a label of no.) To activate the new device, first select it with
a mouse click and then choose on the Activate button. If it does not come up
properly, you may need to reconfigure it by choosing Edit.
Managing Routes
In the Routes management screen you have the ability to add, edit, or remove static
networking routes. Adding or editing an entry involves identical actions, just like the
Hosts panel. An edit dialog box will appear; simply type the new information and
click Done when you are finished. See Figure 335, Adding/Editing Routes for an
example.
132 Chapter 3:System Configuration
Figure 335 Adding/Editing Routes
3.2.4 Time and Date
The "time machine" allows you to change the time and date by clicking on the ap-
propriate part of the time and date display and clicking on the arrows to change the
value.
The system clock is not changed until you click on the Set System Clock button.
Click on Reset Time to set the time machine time back to that of the system.
Please Note
Changing the time can seriously confuse programs that de-
pend on the normal progression of time, and could possibly
cause problems. Try to quit as many applications and pro-
cesses as possible before changing the time or date.
Section 4.3:Installing PowerTools Packages 133
4 PowerTools
4.1 PowerTools Packages
Red Hat PowerTools is a collection of software packages built for the Red Hat Linux
6.2 operating system. PowerTools includes the latest versions (as of this products
release date) of hundreds of programs -- so finding an interesting application should
be easy.
Among the many applications are audio programs, chat clients, development tools,
editors, file managers, emulators, games, graphics programs, productivity applica-
tions, math/statistics packages, systems administration and network management
tools, and window managers.
Additionally, for PalmPilot personal organizer users, the pilot directory on the
CD-ROM contains applications for use with PalmPilots.
Now that you know what you can find on PowerTools, you may want to know how
to install them. See Section 4.3, Installing PowerTools Packages for installation in-
formation.
4.2 Reading the Contents of the CD-ROM
You can read the contents of the PowerTools CD-ROM from a shell prompt
(either in a terminal window or in console mode). Then mount the CD-ROM
(mount /mnt/cdrom). Once this is done, change directories by issuing the cd
/mnt/cdrom command. Finally, type less CONTENTS to view the available
applications.
4.3 Installing PowerTools Packages
4.3.1 Installing PowerTools in a GUI Environment
If youre using GNOME or KDE, place the CD-ROM in your CD-ROM drive. Youll
be prompted for the root password (you must to be root in order to install packages).
After you type in the root password, either the Gnome-RPM or the Kpackage package
134 Chapter 4:PowerTools
management program will start automatically (depending on you GUI environment)
and can be used to install PowerTools.
See Chapter 7, Gnome-RPM for specific instructions on how to use Gnome-RPM. See
http://www.general.uwa.edu.au/u/toivo/kpackage/ for more information on how to
use Kpackage.
If youre not using GNOME or KDE, youll need to use the shell prompt to install
PowerTools. See Section 4.3.2, Installing PowerTools fromthe Shell Prompt for more
information.
4.3.2 Installing PowerTools from the Shell Prompt
First, mount the PowerTools CD-ROM on your CD-ROM drive.
Place the PowerTools CD in your CD-ROM drive. As root, type the following:
# mount -t iso9660 /dev/cdrom /mnt/cdrom
#
Please note
On your system, you or the system administrator may
already allow users (instead of only root) to mount the
CD-ROM drive. Users have this privilege if the user
option is included in the /dev/cdrom line in the
/etc/fstab file. However, keep in mind that you must
be logged in as root to install any PowerTools RPMs.
After youve mounted the drive, cd to the mounted CD-ROM directory with the fol-
lowing command:
# cd /mnt/cdrom
When you list the contents of the CD with ls, youll see the following directories:
SRPMS, alpha, i386, i586, i686, noarch, nosrc, sparc, and sparc64.
The SRPMS directory contains the PowerTools source RPMs. The alpha, i386,
Section 4.3:Installing PowerTools Packages 135
sparc, and sparc64 directories contain the RPMs for the three specified operating
system architectures. The noarch directory contains RPMs which are not architec-
ture-specific and should install on any of the three architectures.
The i386 path is used as a general example. You should substitute the correct di-
rectory for i386, depending upon your architecture and which package youre in-
stalling.
cd to the i386 directory:
# cd i386
#
List the RPM files in the directory with ls to see the complete list of RPM packages
included for Intel-compatible systems.
You will probably want more information about a specific package before you can
decide whether you want to install it. You can use RPMs querying capability to find
out more information about the packages, such as the packages functions and origi-
nation. See Section 6.3, Impressing Your Friends with RPM for instructions on how
to query packages using RPM.
You can install your selected packages with RPM. RPM is a powerful command line-
driven package management system. See Chapter 6, Package Management with RPM
for more information on how to use RPM to install and manage PowerTools packages.
Once you have finished installing your packages, youll need to unmount your
CD-ROM. Type umount /mnt/cdrom to unmount the CD-ROM. Type eject
/mnt/cdrom and the CD-ROM drive will open so that you can remove the CD.
136 Chapter 4:PowerTools
Section 5.1:Starting Update Agent 137
5 Working with Update Agent
One of the more convenient ways to keep your Red Hat Linux system up to date is
through Update Agent. This utility allows you to automatically locate, download and
install updated packages from Red Hat for your system.
Through a secure connection to priority.redhat.com, Red Hats own fast ac-
cess FTP server, youre assured that newpackages are specific to your Red Hat Linux
system, rather than might be the case with upgrades you could find through another
source. Upgrades and bug fixes are presented to you on a single "page" in your Web
browser. You can select individual packages or all of the packages for download.
You can also configure Update Agent to automatically install the new packages once
theyve been downloaded.
By using priority.redhat.com, you can save yourself the time and trouble of
searching for and downloading individual packages from numerous FTP servers.
Please note
To use Update Agent, you must first register your copy of
Red Hat Linux 6.2. To register, go to http://www.red-
hat.com/now. Once you register, you can select a user
name and password which you should use to configure
Update Agent. Please refer to Section 5.2, Configuring Update
Agent for more details.
Update Agent can also automatically download specific packages, based on your pref-
erences.
It isnt necessary to have a dedicated line in order to work with Update Agent; if you
have dialup access to an ISP you can also benefit from the applications features.
5.1 Starting Update Agent
In most cases, Update Agent will be installed as a matter of course during a new instal-
lation or an upgrade.
138 Chapter 5:Working with Update Agent
To start the application in GNOME, select the Main Menu Button on the Panel, then go
to System => Update Agent. If youre using KDE as your graphical environment, you
can start Update Agent by going to the Panel => Red Hat => System => Update Agent.
Figure 51 Box Requesting Root Password
Please Note
Only root can use Update Agent. Each time you start the ap-
plication from your user account, you will be asked to sup-
ply your root password, as Figure 51, Box Requesting Root
Password shows. You can also start the Update Agent as root
at a shell prompt by typing /usr/bin/up2date.
After supplying the password, the application will start. Once the application starts,
youll see a screen like Figure 52, Main Update Agent Window. From within this
main dialog, you have the option of connecting to the priority update server, config-
uring or quitting the application.
Before continuing, however, youll have to configure the application with information
thats specific to your machine and software.
5.2 Configuring Update Agent
As shipped, Update Agent will not automatically connect, download and install up-
dated packages. Before proceeding, youll have to supply information about your-
self, such as the user name and password which you selected when you registered
Red Hat Linux 6.2. (To learn more about registration benefits, go to http://www.red-
hat.com/now.)
Section 5.2:Configuring Update Agent 139
Figure 52 Main Update Agent Window
To configure the application, select Configure on the main dialog. (The button labeled
Abort is only active during a download or installation process; selecting this button
causes Update Agent to cease its current work.)
The Configuration dialog presents you with three tabbed windows in which you must
enter information:
User -- Here, youll enter the user name and password which you had selected
when you registered Red Hat Linux 6.2 at http://www.redhat.com/now. You
should also enter an e-mail address to which correspondence regarding update
transactions should be sent.
Retrieval -- Specify the name of the server and certain installation instructions,
such as which version of Red Hat Linux to update and whether to install as well
as download packages.
Exceptions -- Specify files and/or packages which you want to exclude from your
update search, such as kernel-related files.
140 Chapter 5:Working with Update Agent
Lets begin with the User tab. When youre finished, your information should appear
somewhat like Figure 53, User Configuration Tab.
Figure 53 User Configuration Tab
The User dialog is separated into two sections: User Information and E-Mail Addresses.
In the User Information section, enter the user name you specified when you registered
in the box marked User ID. In the box for Password, enter the password you chose when
you registered.
In the E-Mail Addresses section, you should specify the e-mail address to which feed-
back and summaries from Update Agent should be sent for review. You can have the
feedback and summaries sent to numerous accounts, such as your user account. Just
enter the addresses in the Add new box, then click on the Add button. The entry will
appear in the address window.
Now its time to specify your options in the Retrieval tab.
The Retrieval tab is divided into three sections, which detail the location of the priority
updates server, specific download and installation instructions, and the location of
Section 5.2:Configuring Update Agent 141
the directory where updates are stored on your system. (See Figure 54, Retrieval
Configuration Tab for an example.)
Figure 54 Retrieval Configuration Tab
In the Server entry, you should enter priority.redhat.com as the priority up-
dates server, if it isnt already present. The entry for Program is unavailable for you to
specify; it simply indicates the location of the CGI script which executes Update Agent.
Tip
You can still use Update Agent if your registration expires to
priority.redhat.com. Just point the application to
ftp.redhat.com.
Similar to options you might find in Gnome-RPM, the selections which followthe server
information allow you to customize how you want to retrieve and install updates.
Selecting a button chooses that option. Your options are:
142 Chapter 5:Working with Update Agent
Do not replace config files -- Packages which contain configuration files that are
modified on your system will not be selected for updating. Lets say, for exam-
ple, that youve modified the /etc/syslog.conf configuration file. If there
is an update available for sysklogd, which would create a new /etc/sys-
log.conffile, this package will not be downloaded and installed. If you havent
modified the configuration file on your system, it will be available for download-
ing and installation -- and the previous file will be backed up (in this case, as
/etc/syslog.conf.rpmsave).
Display all available packages -- Select this box if you want Update Agent to show you
all the available packages, not just the packages specific to your installed system.
Retrieve packages, but do not install -- By default, this option is selected. When
this option is selected, Update Agent only downloads packages into a temporary
directory. Once downloaded, you will be able to install the packages yourself.
If this option is unchecked, Update Agent will download and automatically install
your selections. Uncheck this option, then, to both download and install updated
packages; to install the packages yourself, refer to the location specified in the
Package storage directory at the bottom of the location.
Keep packages after installation -- Retains the package files after theyve been in-
stalled. This could be useful if you want to keep copies of packages, however
selecting this could potentially eat up quite a bit of disk space.
Attempts to resolve dependencies -- The value associated with this option instructs
Update Agent on the number of times to check for possible dependency problems
with selected packages. The value ranges from 1 to 10, and can be adjusted by
using the scroll buttons on the side of the box. The higher the value, the greater
the number of dependency checks before your updated packages are installed.
Beneath the package options, two additional boxes allow you to specify the version
Section 5.2:Configuring Update Agent 143
The default entry for Package storage directory is set to /var/spool/up2date as
the default, although you can specify a more preferable location. For example, if
youve chosen to download packages without automatically installing them, you may
find that these downloads take up quite a bit of space over time. Specifying a directory
on your filesystem allows you to send these packages to a directory which you know
can accommodate their size.
The Exceptions tab allows you to specify packages or individual files which you dont
want retrieved frompriority.redhat.com and offered as an update. (See Fig-
ure 55, Update Exceptions Tab for an example of this tab.)
Figure 55 Update Exceptions Tab
In this tab, you have the opportunity to specify which files and packages you would
prefer not to be updated or modified. Both entries -- Skip Packages and Skip Files --
allow you to use wildcards, such as an asterisk (*) and a question mark (?).
The default entry in the Skip Packages section lists kernel*, meaning that any packages
which begin with kernel are excluded from download and installation. Most users
will likely want to keep this exclusion.
144 Chapter 5:Working with Update Agent
To add new entries, type the name of the package you do not want selected (for ex-
ample exmh* for the e-mail application exmh), then click on the Add button. Your
entry will be added to the list.
Like the Skip Packages option, the Skip Files section allows you to specify individual
files you do not want selected. For example, if you want to exclude all the files in
/home, you would enter /home/* and the accounts in /home will be excluded
from updates.
5.3 Using Update Agent
When you sign up for services at http://www.redhat.com/now, you can select an op-
tion to receive update notifications by e-mail. If you choose, youll be told when
updates are available, based on your preferences.
Once you receive an update notification and have correctly configured Update Agent,
you can begin to use it to connect to priority.redhat.comfor updates to down-
load and install.
Please note
You must have either a dedicated connection, or be con-
nected to your ISP through a dialup connection to use Update
Agent.
To begin a session, start Update Agent (in System => Update Agent), and provide the root
accounts password.
Fromthe main screen of the application, click on Connect. The status bar at the bottom
of the window will indicate that the application is connecting and retrieving informa-
tion from the updates FTP site.
If you have chosen to exclude packages or files (such as kernel updates), you may see
a response similar to Figure 56, Excluded Files. Click on the OK button to continue.
Section 5.3:Using Update Agent 145
Figure 56 Excluded Files
The status bar on the main Update Agent window will indicate the the application is
creating a page which will be displayed in your Web browser. Once its finished
sorting the packages and building the page, your browser will open and youll see
results similar to Figure 57, Available Updates.
If there are updated packages available, youll see the name of the package, a sum-
mary of its function and related details, such as the latest version number, the release
number and the size of the package.
146 Chapter 5:Working with Update Agent
Figure 57 Available Updates
You can select individual packages by scrolling down the page and checking the box
next to the package. When youre finished, click on the Request selected packages
button at the bottom of the page.
If youd prefer to update your system with all the available packages, click on the
Request ALL packages button; you wont be required to make individual selections
beside each package.
After youve made your request for the packages, the browser window will close.
(You may receive a message in a window, asking you whether you want to close the
window; confirm this decision by clicking on OK.)
Section 5.3:Using Update Agent 147
Figure 58 Beginning the download process
Next, youll see that the packages which are being downloaded will be shown in the
main Update Agent screen, under Package Name and a small button will appear next to
each package in the Status column, similar to Figure 58, Beginning the download
process.
When packages have completed downloading, the button in the Status column will
reflect this change by becoming a red arrow. The arrow will become a check mark
when each package has been successfully installed. The progress bar on the lower
right of the window will reflect the work which remains before all the updates have
been downloaded and installed.
After all the packages have been retrieved and/or installed on your system, a win-
dow will open informing you of the successful procedure. Youll also receive e-mail
verification that youd performed the procedure; the verification will be sent to the
address youd specified as your User ID.
148 Chapter 5:Working with Update Agent
To quit Update Agent once all the packages have been retrieved and installed, click on
the Quit button.
Section 6.1:RPM Design Goals 149
6 Package Management with RPM
The RPM Package Manager (RPM), is an open packaging system available for any-
one to use, and works on Red Hat Linux as well as other Linux and UNIX systems.
Red Hat, Inc. encourages other vendors to take the time to look at RPM and use it
for their own products. RPM is distributable under the terms of the GPL.
For the end user, RPM provides many features that make maintaining a system far
easier than it has ever been. Installing, uninstalling, and upgrading RPM packages
are all one line commands, and all the messy details have been taken care of for you.
RPM maintains a database of installed packages and their files, which allows you to
perform powerful queries and verification of your system.
During upgrades, RPM handles configuration files specially, so that you never lose
your customizations -- a feature that is impossible with straight .tar.gz files.
For the developer, RPM allows you to take source code for software and package it
into source and binary packages for end users. This process is quite simple and is
driven from a single file and optional patches that you create. This clear delineation
of "pristine" sources and your patches and build instructions eases the maintenance
of the package as new versions of the software are released.
Please Note
Although it can be important to understand the concepts be-
hind RPM, for those who prefer a graphical interface to the
command line, we suggest you use Gnome-RPM. Please see
Chapter 7, Gnome-RPM for more information.
6.1 RPM Design Goals
Before trying to understand how to use RPM, it helps to have an idea of what the
design goals are.
Upgradability
150 Chapter 6:Package Management with RPM
With RPM you can upgrade individual components of your system without
completely reinstalling. When you get a new release of an operating system
based on RPM (such as Red Hat Linux), you dont need to reinstall on your
machine (as you do with operating systems based on other packaging systems).
RPM allows intelligent, fully-automated, in-place upgrades of your system.
Configuration files in packages are preserved across upgrades, so you wont
lose your customizations.
Powerful Querying
RPM is also designed to have powerful querying options. You can do searches
through your entire database for packages or just certain files. You can also
easily find out what package a file belongs to and where it came from. The
files an RPM package contains are in a compressed archive, with a custom
binary header containing useful information about the package and its contents,
allowing you to query individual packages quickly and easily.
System Verification
Another powerful feature is the ability to verify packages. If you are worried
that you deleted an important file for some package, simply verify the package.
You will be notified of any anomalies. At that point, you can reinstall the
package if necessary. Any configuration files that you modified are preserved
during reinstallation.
Pristine Sources
A crucial design goal was to allow the use of "pristine" software sources, as
distributed by the original authors of the software. With RPM, you have the
pristine sources along with any patches that were used, plus complete build
instructions. This is a big advantage for several reasons. For instance, if a
new version of a program comes out, you dont necessarily have to start from
scratch to get it to compile. You can look at the patch to see what you might
need to do. All the compiled-in defaults, and all of the changes that were made
to get the software to build properly are easily visible this way.
Section 6.2:Using RPM 151
This goal may only seem important for developers, but it results in higher qual-
ity software for end users too. We would like to thank the folks from the BO-
GUS distribution for originating the pristine source concept.
6.2 Using RPM
RPM has five basic modes of operation (not counting package building): installing,
uninstalling, upgrading, querying, and verifying. This section contains an overview
of each mode. For complete details and options try rpm --help, or turn to Section
6.4, Other RPM Resources for more information on RPM.
6.2.1 Installing
RPM packages typically have file names like foo-1.0-1.i386.rpm, which in-
cludes the package name (foo), version (1.0), release (1), and architecture (i386).
Installing a package is as simple as:
# rpm -ivh foo-1.0-1.i386.rpm
foo ####################################
#
As you can see, RPMprints out the name of the package (which is not necessarily the
same as the file name, which could have been 1.rpm), and then prints a succession
of hash marks as the package is installed, as a progress meter.
Installing packages is designed to be simple, but you can get a few errors:
Package Already Installed
If the package is already installed, you will see:
# rpm -ivh foo-1.0-1.i386.rpm
foo package foo-1.0-1 is already installed
error: foo-1.0-1.i386.rpm cannot be installed
#
If you really want to install the package anyway, you can use --replacepkgs on
the command line, which tells RPM to ignore the error:
# rpm -ivh --replacepkgs foo-1.0-1.i386.rpm
foo ####################################
152 Chapter 6:Package Management with RPM
#
Conflicting Files
If you attempt to install a package that contains a file which has already been installed
by another package, youll see:
# rpm -ivh foo-1.0-1.i386.rpm
foo /usr/bin/foo conflicts with file from bar-1.0-1
error: foo-1.0-1.i386.rpm cannot be installed
#
To cause RPM to ignore that error, use --replacefiles on the command line:
# rpm -ivh --replacefiles foo-1.0-1.i386.rpm
foo ####################################
#
Unresolved Dependency
RPM packages can "depend" on other packages, which means that they require other
packages to be installed in order to run properly. If you try to install a package for
which there is such an unresolved dependency, youll see:
# rpm -ivh bar-1.0-1.i386.rpm
failed dependencies:
foo is needed by bar-1.0-1
#
To handle this error you should install the requested packages. If you want to force
the installation anyway (a bad idea since the package probably will not run correctly),
use --nodeps on the command line.
6.2.2 Uninstalling
Uninstalling a package is just as simple as installing:
# rpm -e foo
#
Section 6.2:Using RPM 153
Notice that we used the package name "foo," not the name of the original package
file "foo-1.0-1.i386.rpm".
You can encounter a dependency error when uninstalling a package if some other
installed package depends on the one you are trying to remove. For example:
# rpm -e foo
removing these packages would break dependencies:
foo is needed by bar-1.0-1
#
To cause RPM to ignore that error and uninstall the package anyway (which is also
a bad idea since the package that depends on it will probably fail to work properly),
use --nodeps on the command line.
6.2.3 Upgrading
Upgrading a package is similar to installing.
# rpm -Uvh foo-2.0-1.i386.rpm
foo ####################################
#
What you dont see above is that RPM automatically uninstalled any old versions of
the foo package. In fact you may want to always use -U to install packages, since
it works fine even when there are no previous versions of the package installed.
Since RPM performs intelligent upgrading of packages with configuration files, you
may see a message like:
saving /etc/foo.conf as /etc/foo.conf.rpmsave
This means that your changes to the configuration file may not be "forward compati-
ble" with the new configuration file in the package, so RPM saved your original file,
and installed a new one. You should investigate and resolve the differences between
the two files as soon as possible to ensure that your system continues to function
properly.
154 Chapter 6:Package Management with RPM
Since upgrading is really a combination of uninstalling and installing, you can en-
counter any errors from those modes, plus one more: If RPM thinks you are trying
to upgrade to a package with an older version number, you will see:
# rpm -Uvh foo-1.0-1.i386.rpm
foo package foo-2.0-1 (which is newer) is already installed
error: foo-1.0-1.i386.rpm cannot be installed
#
To cause RPM to "upgrade" anyway, use --oldpackage on the command line:
# rpm -Uvh --oldpackage foo-1.0-1.i386.rpm
foo ####################################
#
6.2.4 Freshening
Freshening a package is similar to upgrading:
# rpm -Fvh foo-1.2-1.i386.rpm
foo ####################################
#
RPMs freshen option checks the versions of the packages specified on the command
line against the versions of packages that have already been installed on your system.
When a newer version of an already-installed package is processed by RPMs freshen
option, it will be upgraded to the newer version. However, RPMs freshen option will
not install a package if no previously-installed package of the same name exists. This
differs from RPMs upgrade option, as an upgrade will install packages, whether or
not an older version of the package was already installed.
RPMs freshen option works well with single packages or with a group of packages.
Its especially handy if youve just downloaded a large number of different pack-
ages, and you only want to upgrade those packages that are already installed on your
system. Using the freshen option means that you wont have to pick through the
downloaded packages, deleting any unwanted ones before using RPM.
In this case, you can simply issue the following command:
# rpm -Fvh *.rpm
Section 6.2:Using RPM 155
RPMwill automatically upgrade only those packages that have already been installed.
6.2.5 Querying
Querying the database of installed packages is accomplished with rpm -q. Asimple
use is rpm -q foo which will print the package name, version, and release number
of the installed package foo:
# rpm -q foo
foo-2.0-1
#
Instead of specifying the package name, you can use the following options with -q
to specify the package(s) you want to query. These are called Package Specification
Options.
-a queries all currently installed packages.
-f <file> will query the package owning <file>.
-p <packagefile> queries the package <packagefile>.
There are a number of ways to specify what information to display about queried
packages. The following options are used to select the type of information for which
you are searching. These are called Information Selection Options.
-i displays package information such as name, description, release, size, build
date, install date, vendor, and other miscellaneous information.
-l displays the list of files that the package "owns".
-s displays the state of all the files in the package.
-d displays a list of files marked as documentation (man pages, info pages,
READMEs, etc).
-c displays a list of files marked as configuration files. These are the files you
change after installation to adapt the package to your system (sendmail.cf,
passwd, inittab, etc).
156 Chapter 6:Package Management with RPM
For those options that display file lists, you can add -v to your command line to get
the lists in a familiar ls -l format.
6.2.6 Verifying
Verifying a package compares information about files installed from a package with
the same information from the original package. Among other things, verifying com-
pares the size, MD5 sum, permissions, type, owner and group of each file.
The command rpm -V verifies a package. You can use any of the Package Selection
Options listed for querying to specify the packages you wish to verify. A simple use
is rpm -V foo which verifies that all the files in the foo package are as they were
when they were originally installed. For example:
To verify a package containing particular file:
rpm -Vf /bin/vi
To verify ALL installed packages:
rpm -Va
To verify an installed package against an RPM package file:
rpm -Vp foo-1.0-1.i386.rpm
This can be useful if you suspect that your RPM databases are corrupt.
If everything verified properly there will be no output. If there are any discrepancies
they will be displayed. The format of the output is a string of 8 characters, a possible
"c" denoting a configuration file, and then the file name. Each of the 8 characters
denotes the result of a comparison of one attribute of the file to the value of that
attribute recorded in the RPM database. A single "." (period) means the test passed.
The following characters denote failure of certain tests:
5 -- MD5 checksum
Section 6.3:Impressing Your Friends with RPM 157
S -- File size
L -- Symbolic link
T -- File modification time
D -- Device
U -- User
G -- Group
M -- Mode (includes permissions and file type)
If you see any output, use your best judgment to determine if you should remove or
reinstall the package, or otherwise fix the problem.
6.3 Impressing Your Friends with RPM
RPM is a very useful tool for both managing your system and diagnosing and fixing
problems. The best way to make sense of all the options is to look at some examples.
Lets say you delete some files by accident, but you arent sure what you deleted.
If you want to verify your entire systemand see what might be missing, you would
enter:
rpm -Va
If some files are missing, or appear to have been corrupted, you should probably
either re-install the package or uninstall, then re-install the package.
Lets say you run across a file that you dont recognize. To find out which pack-
age owns it, you would enter:
rpm -qf /usr/X11R6/bin/xjewel
The output would look like:
xjewel-1.6-1
158 Chapter 6:Package Management with RPM
We can combine the above two examples in the following scenario. Say you are
having problems with /usr/bin/paste. You would like to verify the package
that owns that program but you dont know which package that is. Simply enter:
rpm -Vf /usr/bin/paste
and the appropriate package will be verified.
Want to find more about a particular program? You can find out by entering the
following to locate the documentation which came with the package that "owns"
that program (in this case ispell):
rpm -qdf /usr/bin/ispell
The output would be:
/usr/man/man4/ispell.4
/usr/man/man4/english.4
/usr/man/man1/unsq.1
/usr/man/man1/tryaffix.1
/usr/man/man1/sq.1
/usr/man/man1/munchlist.1
/usr/man/man1/ispell.1
/usr/man/man1/findaffix.1
/usr/man/man1/buildhash.1
/usr/info/ispell.info.gz
/usr/doc/ispell-3.1.18-1/README
Lets say you find a new koules RPM, but you dont know what it is. To find out
some information on it, enter:
rpm -qip koules-1.2-2.i386.rpm
The output would be:
Name : koules Distribution: Red Hat Linux Colgate
Version : 1.2 Vendor: Red Hat Software
Release : 2 Build Date: Mon Sep 02 11:59:12 1996
Install date: (none) Build Host: porky.redhat.com
Group : Games Source RPM: koules-1.2-2.src.rpm
Size : 614939
Summary : SVGAlib action game; multiplayer, network
Section 6.4:Other RPM Resources 159
Description :
This arcade-style game is novel in conception and
excellent in execution. No shooting, no blood, no guts,
no gore. The play is simple, but you still must develop
skill to play. This version uses SVGAlib to run on a
graphics console.
Now you want to see what files the koules RPM installs. You would enter:
rpm -qlp koules-1.2-2.i386.rpm
The output is:
/usr/man/man6/koules.6
/usr/lib/games/kouleslib/start.raw
/usr/lib/games/kouleslib/end.raw
/usr/lib/games/kouleslib/destroy2.raw
/usr/lib/games/kouleslib/destroy1.raw
/usr/lib/games/kouleslib/creator2.raw
/usr/lib/games/kouleslib/creator1.raw
/usr/lib/games/kouleslib/colize.raw
/usr/lib/games/kouleslib
/usr/games/koules
These are just several examples. As you use the system you will find many more uses
for RPM.
6.4 Other RPM Resources
For more information on RPM, check out the man page, the help screen (rpm
--help), and the RPM documents available at
http://www.rpm.org/
There is also an RPM book available. Its called Maximum RPM, and it is available
from Red Hat, at your local bookstore and through online booksellers. It contains a
wealth of information about RPM for both the end-user and the package builder.
160 Chapter 6:Package Management with RPM
An on-line version of the book is available at http://www.rpm.org/.
There is also a mailing list for discussion of RPM-related issues, called
rpm-list@redhat.com.
The list is archived on http://www.redhat.com/support/mailing-lists/. To subscribe,
send mail to rpm-list-request@redhat.com with the word subscribe in
the subject line.
Gnome-RPM 161
7 Gnome-RPM
One of the most convenient package manipulation tools available is Gnome-RPM, a
graphical tool which runs under the X Window System. Gnome-RPM was written by
James Henstridge (james@daa.com.au); RPM 3.0 support was written by Red
Hat and additional rpmfind code was written by Daniel Veillard.
Gnome-RPM (which is also referred to as gnorpm) allows the end-user to easily work
with RPM technology; it is fast, powerful and features a friendly interface.
To learn more about RPM technology, turn to Chapter 6, Package Management with
RPM.
Gnome-RPM is "GNOME-compliant," meaning that it seamlessly integrates into
GNOME, the X Window System desktop environment.
With Gnome-RPM, you can easily
install RPM packages
uninstall RPM packages
upgrade RPM packages
find new RPM packages
query RPM packages
verify RPM packages
The interface features a menu, a toolbar, a tree and a display window of currently
installed packages.
Operations are often performed in Gnome-RPM by finding and selecting packages, then
choosing the type of operation to perform via push-button on the toolbar, through the
menu or by right-clicking with the mouse.
Installing a package places all of the components of that package on your system
in the correct locations.
Uninstalling a package removes all traces of the package except for configuration
files you have modified.
162 Chapter 7:Gnome-RPM
Upgrading a package installs the newly available version and uninstalls all other
versions that were previously installed. This allows quick upgrading to the latest
releases of packages. Refer to Section 7.4, Configuration for information about
how to alter the default settings for installing and uninstalling packages.
You can also use the Web find option to search the Internet for newly released pack-
ages. You can direct Gnome-RPM to search for particular distributions when you want
to look for new packages. (If you have a slow connection, this option can take some
time to fully execute.) See Section 7.4, Configuration for more information about
this feature.
Please Note
Exercise caution if you choose to use the Web find option,
since there is no way to verify the integrity of the many
packages which are available at numerous repositories. Be-
fore installing packages, you should performa query on that
package to help you determine whether it can be trusted.
Packages not produced by Red Hat are not supported in any
way by Red Hat.
Using Gnome-RPM to perform all of these and many other operations is the same as
using rpm from the shell prompt. However, the graphical nature of Gnome-RPM often
makes these operations easier to perform.
The usual way to work with Gnome-RPM is to display the available packages, select the
package(s) you want to operate on, and then select an option fromthe toolbar or menu
which performs the operation. However, Gnome-RPM is flexible enough to display
packages in a variety of views, thanks to the use of filters. Refer to Section 7.3,
Installing New Packages for more information on using filters to identify packages.
You can install, upgrade or uninstall several packages with a few button clicks. Sim-
ilarly, you can query and verify more than one package at a time. Because of Gnome-
RPMs integration with GNOME, you can also perform installation, query and verifi-
cation on packages from within the GNOME File Manager.
Section 7.1:Starting Gnome-RPM 163
7.1 Starting Gnome-RPM
You can start Gnome-RPM from either an Xterm window or from the GNOME desktop
Panel (Main Menu Button => System => GnoRPM).
To start Gnome-RPM from an Xterm window, at the shell prompt, simply type
gnorpm &
That will bring up the main Gnome-RPM window (as shown in Figure 71, Main
Gnome-RPM Window).
Please Note
If you would like to install, upgrade or uninstall packages,
you must be in root. The easiest way to do this is to type su
to become root, and then type the root password at a shell
prompt. However, it isnt necessary to be root in order to
query and verify packages.
There are several parts to the Gnome-RPM interface.
Package Panel - On the left; allows you to browse and select packages on your
system.
Display window - To the right of the package panel; shows you contents from
folders in the panel.
Toolbar - Above the display and panel; a graphical display of package tools.
Menu - Above the toolbar; contains text-based commands, as well as help info,
preferences and other settings.
Status bar - Beneath the panel and display windows; shows the total number of
selected packages.
164 Chapter 7:Gnome-RPM
Figure 71 Main Gnome-RPM Window
7.2 The Package Display
Each folder icon in the tree view at left represents a group of packages. Each group
can contain subgroups. Groups are used to place packages that perform similar func-
tions in similar locations. For example, the folder Editors contains text editors such
as ed, vim and GXedit. From the tree view on the left, you might find another folder
beneath Editors called Emacs, which would contain both emacs and emacs-X11.
The tree view is also arranged in an expandable and collapsible manner, which helps
you to easily navigate through the packages. A folder which appears with a + next to
it indicates that there are subfolders within that category.
To view the packages and subgroups within a group, click once on a folder or a +
with your left mouse button. The display window will then show you the contents of
that folder. By default, you will be presented with icons to represent the packages.
You can change that view to a list view by selecting View as list from the Interface tab
Section 7.2:The Package Display
166 Chapter 7:Gnome-RPM
button, while holding down the [Ctrl] key; youll see highlighting around each addi-
tional selection.
To select more than one package globally, that is, make larger selections within a
folder, left-click one package, then, while holding down the [Shift] key, left-click on the
final package you wish to select. By doing so, youll notice that individual packages
between your starting and ending selections will also be highlighted for selection.
Using this option makes selecting groups of packages quicker than selecting each
package individually.
The status bar at the bottom of Gnome-RPM will display the total number of packages
you have selected.
7.3 Installing New Packages
To install new packages, choose Install from the toolbar. The Install window will open,
revealing packages which are either already installed, newer packages or other op-
tions, which can be selected from the Filter drop-down bar at the top of the window.
See Figure 74, The Add Packages Window for an example of the Install window, us-
ing the filter for "All but installed packages."
Using the Filter feature allows you to winnow your choices for viewing packages.
Available filters for viewing include:
All packages
All but installed packages
Only uninstalled packages
Only newer packages
Uninstalled or newer packages
You can switch the display of packages by using the drop-down bar at the top of the
window.
Section 7.3:Installing New Packages 167
Figure 73 The Install Window
Choose the Add button. By default, if your CD-ROM is mounted with a Red Hat
Linux CD-ROM, Gnome-RPM will search in /mnt/cdrom/RedHat/RPMS for new
packages. (You can find this default option in the Install Window tab of the Preferences
dialog. See Section 7.4, Configuration for more information on this feature.)
If no packages are available in the default path, youll be presented with an Add Pack-
ages windowfromwhich you can select the appropriate location of your newpackage.
In this view, you can select the correct path by using the drop-down bar at the top of
the window to quickly navigate to pre-set locations; or you can double-click in the
left panel of the Add Packages window to navigate to the correct path (as in Figure
74, The Add Packages Window). You can also type the path in the text window at
the bottom of the Add Packages window.
168 Chapter 7:Gnome-RPM
Figure 74 The Add Packages Window
Please Note
If you download RPMs, youll likely find those down-
loaded packages in a directory called rpms within your
home directory. For example, if your home directory
is /home/bill, your downloaded RPMs will be in
/home/bill/rpms.
By clicking on the item, youll find a brief description of the package in the Package
Info panel of the Install window. To perform an installation or a query on the pack-
age, click inside the checkbox next to the package, then select the Install button. You
can also query the item once its checked; from within the Package Info window, you
can also perform the installation (see Figure 710, Query Window in Section 7.5.1,
Querying Packages for an example).
Section 7.4:Configuration 169
To choose an item, double-click on it with your left mouse button, or click on the Add
button. The selected package(s) will be added to the Install window. You can also
install more than one package in the same manner; each selection will be added to
the Install window.
In addition to choosing to install the packages fromwithin the Install window, you can
install after performing a query on the selected package. Click on Query, which will
open the Package Info window. Here, you can find a variety of details about the file(s)
youve selected to install. Information will include the origination of the package,
the date it was built, its size and more.
Within this Package Info window, you have the option of installing or upgrading pack-
ages.
If the package already exists on your system and youre querying a newer release,
the Package Info window provides an Upgrade button, which will perform an upgrade
to newer releases.
You can also "drag and drop" packages from GNOME File Manager. Within the File Man-
ager, left-click on your selected RPM file then, while still holding down the mouse
button, "drag" the file to the Install window and place it within the Name panel.
When dragging files to the Install window from the File Manager, youll notice that the
file appears as an icon while its being dragged toward Gnome-RPM. Once inside the
Name panel, youll see that the package is checked for installation by default, and its
information appears in the Package Info panel to the right.
To install the package now, just select the Install button.
Youll see a progress indicator when your package is being installed.
7.4 Configuration
Gnome-RPM offers a wide selection of choices for installing and uninstalling packages,
documentation and other features. You can customize Gnome-RPM through the Prefer-
ences dialog, which you can access from Operations => Preferences on the menu. To
make selections in the many of the Preferences dialogs, select the check boxes next to
the options.
170 Chapter 7:Gnome-RPM
Under the Behavior tab, youll find a number of options for configuring the way
Gnome-RPM installs, uninstalls and upgrades packages. The Behavior tab is split
into five sections: Install, Upgrade, Other, Database and Architecture. Note that by
default these boxes are not checked (see Figure 75, Behavior Tab in Preferences).
Figure 75 Behavior Tab in Preferences
Under Install Options, you have the following choices:
No dependency checks - When selected, this will install or upgrade a package with-
out checking for other types of files on which the program may be dependent in
order to work. However, unless you know what youre doing we strongly suggest
you not use this option as some packages may depend on other packages for files,
libraries or programs to function correctly.
No reordering - This option is useful if RPM is unable to change the installation
order of some packages to satisfy dependencies.
Section 7.4:Configuration 171
Dont run scripts - Pre- and post-install scripts are sequences of commands that
are sometimes included in packages to assist with installation. This check box is
similar to the --noscripts option when installing from the shell prompt.
Under Upgrade Options, you can select the following:
Allow replacement of packages - Replaces a package with a new copy of itself.
Similar to the --replacepkgs option from the shell prompt. This option can
be useful if an already-installed package has become damaged or may require
other repair to function correctly.
Allow replacement of files - Allows the replacement of files which are owned by an-
other package. The shell prompt equivalent for this RPMoption is --replace-
files. This option can sometimes be useful when there are two packages with
the same file name but different contents.
Allow upgrade to old version - Like the shell prompt RPM option equivalent
--oldpackage, this option allows you to "upgrade" to an earlier package.
It can sometimes be useful if the latest version of a package doesnt function
correctly for your system.
Keep packages made obsolete - Prevents packages listed in an Obsoletes header
from being removed.
In Other Options, you can select:
Dont install documentation - Like --excludedocs, this option can save on disk
space by excluding documentation such as man pages or other information related
to the package.
Install all files - Installs all files in the package.
The choices available in Database Options and Architecture Options allow you to decide,
among other things, whether you want to perform a "test" installation (which will
check for file conflicts without actually performing an install), or whether you want
to exclude packages for other operating systems or system architectures.
In the Package Listing tab, youll find a choice of displays for your packages: either
View as icons, which will be graphically-based, or View as list, which is not graphical
but can provide more information about the packages.
172 Chapter 7:Gnome-RPM
In Install Window,, you can specify the path through which Gnome-RPM can find new
RPMs on your system. Refer to Figure 76, Install Window for an example of this
dialog. If youre using your Red Hat Linux CD-ROM, this path will probably be
/mnt/cdrom/RedHat/RPMS
or a similar path which had been set as the default path for Gnome-RPM. If you
download new RPMs from the Internet or want to install RPMs via a NFS-mounted
CD-ROM this path will be different for you.
Figure 76 Install Window
To change this path, type the full path to the RPMs youd like to work with. Choos-
ing the Apply or OK buttons will save this path, making it the default path for future
sessions. You can also determine the default path by selecting the Browse button,
and visually navigating through the RPMPath window.
After changing install path and closing the dialog box, you can use the Install button
to view the packages available in your new location.
Section 7.4:Configuration 173
(If the path for your RPMs doesnt match the default path in your preferences, youll
be presented with a browser window, which will allow you to select the correct path
for your new RPMs.)
Under Package Colors, youll find color coding for packages. The default setting for
older packages is gray; for current packages, the color is green; for newer packages
than those installed, the color is blue. These color values can be customized to suit
your needs.
The RPM Directories, contains a listing of default locations where Gnome-RPM will
search for packages.
In Network, you have the ability to specify proxies for use with HTTP and FTP trans-
fers, as well as user and password names (see Figure 77, Network Settings). Note,
however, that the password will not be stored securely.
In the Cache expire window, you can set the length of time before data from the rpmfind
database is considered out of date.
Figure 77 Network Settings
174 Chapter 7:Gnome-RPM
In Rpmfind and Distributions, youll find settings and options which correspond to the
Web find feature.
The Rpmfind system was devised by Daniel Veillard, and allows the user to search the
Internet for packages by name, summary, architecture and more (see Figure 78, The
Rpmfind Window). The user is then given the option of downloading and installing
the most appropriate packages for their system. To learn more about Rpmfind, go to
http://rpmfind.net/.
Figure 78 The Rpmfind Window
The Metadata server sets the server to be used for searches. The Download dir: entry
allows you to specify where you want the files to be placed.
You can also specify the vendor, distribution name and whether to find sources and/or
the latest files.
Section 7.5:Package Manipulation 175
Figure 79 Distribution Settings in Preferences
In Distribution Settings, you can set the options for choosing the most appropriate pack-
age out of the selections Rpmfind returns, as well as which mirror you would like to
use. The higher the rating you indicate for your selection (as shown in Figure 79,
Distribution Settings in Preferences) the higher the priority it will receive; the lower
rating, such as "-1," will specify that packages not be recommended.
7.5 Package Manipulation
7.5.1 Querying Packages
The easiest way to query packages is to use the Query option from the menu at the
top. If you want to query more than one package, make all your selections then press
the Query button on the menu.
Youll be presented with a windowlike the one shown in Figure 710, Query Window.
The more packages youve queried, the more "tabs" youll find within the Query box,
each tab representing a Query window for a package.
176 Chapter 7:Gnome-RPM
Figure 710 Query Window
The name of the package is centered at the top of the box. Below, the box is divided
into two columns of listed information; below this information, youll see a display
area showing package files.
In the left column in the information list, youll find the size of the file, the machine
on which the file is found, the name of the package distribution and the group to
which its function belongs.
In the right column, youll find the date of the packages installation on your machine,
the date the package was built, the name of the vendor and the name of the group who
packaged the software. If the package has not been installed on your machine, that
space will simply read, "not installed." Clicking on the name following Packager will
cause your browsers e-mail application to open in compse, so that you can write to
the packager.
Centered at the bottom of the information list is the URL of the applications devel-
oper (see Figure 711, URL in the Query Window). Similar to the e-mail function of
Section 7.5:Package Manipulation 177
the Packager entry, clicking on the URL will cause your browser to open to the cor-
responding website.
Figure 711 URL in the Query Window
Below the description is a list of the files contained in the package. If a D appears in
its related column to the left of the path, that file is a documentation file and would be
a good thing to read for help on using the application. If a C appears in its respective
column, the file is a configuration file. Under the S column, you can view the "state"
of the package; here, youll receive information if any files are reported as "missing"
from the package (and therefore probably mean theres a problem with the package).
If youre querying a package thats already installed, youll also find two additional
buttons beneath at the bottom of this window: Verify and Uninstall. If youre perform-
ing a query on a package that hasnt been installed yet, the buttons on the bottom will
be labeled Install, Upgrade and Check Sig.
To close the query window without performing any action, left-click on the X at the
top right of the window bar.
178 Chapter 7:Gnome-RPM
7.5.2 Verifying Packages
Verifying a package checks all of the files in the package to ensure they match the ones
present on your system. The checksum, file size, permissions, and owner attributes
are all checked against the database. This check can be used when you suspect that
one of the programs files has become corrupted for some reason.
Choosing the packages to verify is like choosing the packages to query. Select the
packages in the display window and use the Verify button on the toolbar or from Pack-
ages => Verify on the menu. A window opens like the one in Figure 712, Verify
Window.
Figure 712 Verify Window
As the package is being checked, youll see the progress in the Verify window. If
there are any problems discovered during the verify process, theyll be described in
the main display area.
Section 7.5:Package Manipulation 179
7.5.3 Uninstalling Packages
Uninstalling a package removes the application and associated files from your ma-
chine. When a package is uninstalled, any files it uses that are not needed by other
packages on your system are also removed. Changed configuration files are copied
to <filename>.rpmsave so you can reuse them later.
Please Note
Remember that you must be root to uninstall packages.
If uninstalling a package would break "dependencies" (which could hobble other ap-
plications that require one or more of the removed files in the package), a dialog will
pop up, asking you to confirm the deletion. This will occur if you havent selected
the "No dependency checks" box from the Preferences menu (as shown in Figure 713,
The Behavior Tab in Preferences).
Figure 713 The Behavior Tab in Preferences
180 Chapter 7:Gnome-RPM
There are a variety of methods through which you can remove a selected package:
from the menu, under Packages; from the toolbar and from the Query function. If you
decide to remove more than one package at a time, you can choose either an incre-
mental or global selection in the same way as you would when installing, querying or
verifying. The total of your selections will be reflected in the status bar on the bottom
of the main window. Because you can remove more than one package at a time, use
caution to select only those which you wish to remove.
Figure 714 Uninstall Window
Once youve begun the uninstall, Gnome-RPM asks for confirmation, showing a win-
dow like the one in Figure 714, Uninstall Window. All of the packages that are
about to be uninstalled are listed. You should look at them all to ensure youre not
about to remove something you want to keep. Clicking the Yes button will start the
uninstallation process. After it completes, the packages and groups that have been
removed will disappear from any windows they were in.
Section 7.5:Package Manipulation 181
Upgrading Packages
When a new version of a package has been released, it is easy to install it on your
system. Select the packages from the window of available packages in the same way
you select packages for installation. Both the Upgrade button on the toolbar and, from
the menu, under Operations => Upgrade will begin the process. You simply Add pack-
ages in the same manner as you would a new package installation.
During the upgrade, youll see a progress indicator like the one for installing pack-
ages. When its finished, any old versions of the packages will be removed, unless
you specify otherwise (refer to Section 7.4, Configuration for more information).
It is much better to use the upgrade option than to uninstall the old versions of a
package and then install the new one. Using upgrade ensures that any changes you
made to package configuration files are preserved properly, while uninstalling and
then reinstalling a new package could cause those changes to be lost.
If you run out of disk space during an installation, the install will fail. However,
the package which was being installed when the error occurred may leave some files
around. To clean up after this error, reinstall the package after youve made more
disk space available.
182 Chapter 7:Gnome-RPM
Section 8.1:What is LDAP? 183
8 Lightweight Directory Access Protocol
(LDAP)
8.1 What is LDAP?
LDAP (Lightweight Directory Access Protocol) is a proposed open standard for
global or local directory services over a network and/or the Internet. A directory, in
this sense, is very much like a phone book. LDAP can handle other information,
but at present it is typically used to associate names with phone numbers and e-mail
addresses. Directories are designed to support a high volume of queries, but the data
in the directory doesnt change all that often.
LDAP is much more useful than a paper phone book, because LDAPs design is
intended to support propagation over LDAP servers throughout the Internet, much
like the Domain Name Service (DNS). The DNS system acts as the address book
of the Internet by keeping track of domain name/IP address pairs. DNS servers tell
networked machines where packets need to go. In the future, LDAP could provide
the same type of global access to many types of directory information: at present,
LDAP is more commonly used within a single large organization, like a college or a
company, for directory services.
LDAP is a client-server system. An LDAP client connects to an LDAP server and
either queries for information or provides information that needs to be entered into
the directory. The server either answers the query, refers the query to another LDAP
server, or accepts the information for incorporation into the directory.
LDAP is sometimes known as X.500 Lite. X.500 is an international standard for
directories. X.500 is full-featured, but it is complex and requires lots of computing
resources and the full OSI stack. LDAP, in contrast, can run easily on a PC and over
TCP/IP. LDAP can access X.500 directories, but it does not support every capability
of X.500.
This chapter will refer to the configuration and use of OpenLDAP, an open source
implementation of LDAP. OpenLDAP includes slapd, a stand-alone LDAP server;
184 Chapter 8:Lightweight Directory Access Protocol (LDAP)
slurpd, a stand-alone LDAP replication server; libraries implementing the LDAP
protocol; utilities; tools; and sample clients.
8.2 Pros and Cons of LDAP
The main benefit of using LDAP is the consolidation of certain types of information
within your organization. For example, all of the different lists of users within your
organization can be merged into one LDAP directory. This directory can be queried
by any LDAP-enabled applications that need this information. The directory can also
be used by users who need directory information.
Other LDAP benefits include its ease of implementation (compared to X.500), and its
well-defined Application Programming Interface (API), which means that the num-
ber of LDAP-enabled applications and LDAP gateways should increase in the future.
On the negative side, if you want to use LDAP, youll need LDAP-enabled applica-
tions or youll need to use LDAP gateways. As mentioned previously, LDAP will
only increase in usage, but at present, there arent a plethora of LDAP-enabled appli-
cations available for Linux. Also, while LDAP does support some access control, it
does not support as many security features as X.500.
8.3 Uses for LDAP
Several Netscape applications, including Netscape Roaming Access are LDAP-enabled.
Sendmail 8.[89].x can use LDAP to look up addresses. Your organization can use
LDAP as an organization-wide directory and/or name service (in place of NIS or flat
files). You can even use a personal LDAP server to keep track of your own e-mail
address book (see Section 8.10, LDAP Resources on the Web).
LDAP can be used as an authentication service via the pam_ldap module. LDAP
is commonly used as a central authentication server so that users have a unified login
that covers console logins, POP servers, IMAP servers, machines connected to the
network using Samba, and even Windows NT machines. All of these login situations
can rely on the same user ID and password combination, using LDAP.
Section 8.5:OpenLDAP Files 185
8.4 LDAP Terminology
An entry is one unit in an LDAP directory. An entry is identified or referenced by
its unique Distinguished Name (DN).
An entry has attributes; attributes are pieces of information which are directly associ-
ated with the entry. For example, an organization could be an LDAP entry. Attributes
associated with the organization might be its fax number, its address, and so on. Peo-
ple can also be entries in the LDAP directory. Common attributes for people include
their telephone numbers and their e-mail addresses.
Certain attributes are required, while other attributes are optional. An objectclass
sets which attributes are required and which are optional. Objectclass definitions are
found in the slapd.oc.conf file.
The LDAP Data Interchange Format (LDIF) is an ASCII text format for LDAP
entries. Files that import or export data to and from LDAP servers must be in LDIF
format. An LDIF entry looks like this:
[<id>]
dn: <distinguished name>
<attrtype>: <attrvalue>
<attrtype>: <attrvalue>
<attrtype>: <attrvalue>
An entry can contain as many <attrtype>: <attrvalue> pairs as needed. A blank line
indicates that the entry is finished and that another entry is about to begin.
Everything enclosed within < > is variable, and can be set by you when you add an
LDAP entry, with the exception of the <id>. The <id> is a number normally set by
the LDAP tools when you add an entry, and youll probably never need to manually
set one.
8.5 OpenLDAP Files
OpenLDAP configuration files are installed into the /etc/openldap directory. If
you do an ls on /etc/openldap, youll see something like:
$ ls
ldap.conf ldapsearchprefs.conf slapd.at.conf slapd.oc.conf
ldapfilter.conf ldaptemplates.conf slapd.conf
186 Chapter 8:Lightweight Directory Access Protocol (LDAP)
$
The files you should know about are slapd.conf, slapd.at.conf and
slapd.oc.conf. The slapd.conf file contains configuration information for
the slapd daemon and for all of the database back-ends. You will need to make
some changes to slapd.conf before you start the slapd daemon.
The slapd.at.conf file holds attribute syntax definitions for the LDAP direc-
tory. Attribute syntax definitions describe the type of information that the attribute
provides. You have five choices:
bin -- binary information
ces -- case exact string (a string whose case matters)
cis -- case ignore string (a string whose case doesnt matter)
tel -- a telephone number (blank spaces and hyphens are ignored)
dn -- the distinguished name
For example, here are attribute syntax definitions from a typical slapd.at.conf:
attribute photo bin
attribute personalsignature bin
attribute jpegphoto bin
attribute audio bin
attribute labeledurl ces
attribute ref ces
attribute userpassword ces
attribute telephonenumber tel
Certain LDAP-enabled applications may require that you edit the slapd.at.conf
file, usually to add particular attribute syntax definitions.
The slapd.oc.conf file includes the objectclass definitions for an LDAP di-
rectory. The objectclass definitions state which attributes are required and which
attributes are optional for particular objectclasses.
The following excerpt from a typical slapd.oc.conf file contains the objectclass
definitions for the top, alias, and referral objectclasses:
objectclass top
requires
Section 8.6:OpenLDAP Daemons and Utilities 187
objectClass
objectclass alias
requires
aliasedObjectName,
objectClass
objectclass referral
requires
ref,
objectClass
You may need to edit the objectclass definitions in your slapd.oc.conf, depend-
ing upon how youre going to use your LDAP directory. For example, if youre
creating an LDAP directory of employees for use in your organization, youll prob-
ably have specific required attributes for certain objectclasses that might not be used
outside the organization (e.g., an employee ID number internal to your organization
might be a required attribute for an objectclass of "person").
8.6 OpenLDAP Daemons and Utilities
The OpenLDAP package includes two daemons: slapd and slurpd. The slapd
daemon is the stand-alone LDAP daemon, which youll need to run to support LDAP.
The slurpd daemon controls the replication of LDAP directories over a network.
Slurpd sends changes from the master LDAP directory to slave LDAP directories.
You wont need to run slurpd unless you have more than one LDAP server on your
network. If you have two or more LDAP servers, youll need to run slurpd to keep
the LDAP directories in sync.
OpenLDAP also includes some utilities for adding, modifying and deleting entries in
an LDAP directory. The ldapmodify tool is used to modify entries in an LDAP
database. The ldapadd utility is used to add entries to your directory (ldapadd
is actually a hard link to ldapmodify -a). Ldapsearch is used to search for
entries and ldapdelete is used to delete entries. The ldif2ldbm tool converts
an LDIF file into an LDBM back-end database.
See their man pages for more information on all of these utilities.
188 Chapter 8:Lightweight Directory Access Protocol (LDAP)
8.7 Modules for Adding Extra Functionality to LDAP
Red Hat Linux includes the following packages which add functionality to LDAP:
The nss_ldap module is an LDAP module for the Solaris Nameservice Switch
(NSS). NSS is a set of C library extensions necessary for accessing LDAP directory
information, instead of or in addition to the Network Information Service (NIS)
name service and/or flat files. The nss_ldap module is needed to use LDAP as a
native name service.
The pam_ldap module is needed to integrate LDAP authentication into the Plug-
gable Authentication Modules (PAM) API. If you use pam_ldap, users can au-
thenticate and change their password using LDAP directories. The nss_ldap and
pam_ldap modules are provided in the nss_ldap package.
Red Hat Linux also includes LDAP modules for the Apache Web server. The
auth_ldap module is for authenticating HTTP clients against the user entries
in an LDAP directory. The php-ldap module adds LDAP support to the PHP3
HTML-embedded scripting language. The auth_ldap and php-ldap modules
will need to be compiled into Apache as Dynamic Shared Objects (DSOs).
8.8 LDAP How To: A Quick Overview
This section provides a quick overviewof the steps youll need to take to get an LDAP
directory working.
1. Make sure the openldap RPM, and any other LDAP-related RPMS that you
need, are installed.
2. See either the Quick Start Guide at the OpenLDAP site (http://www.openl-
dap.org/faq/data/cache/172.html; start at "Create configuration file for slapd,"
since the LDAP files are already installed), or see the Linux-LDAP HOWTO
(http://www.linuxdoc.org/HOWTO/LDAP-HOWTO.html) for instructions on
using LDAP on your system. Both cover the rest of these steps.
3. Edit the slapd.conf file to get it right for your system.
4. Start slapd.
Section 8.9:Configuring Your System to Authenticate Using OpenLDAP 189
5. Create your LDAP directory (examples of LDAP entries are provided at the
PADL Software website at http://www.padl.com/ldap_examples.html).
6. Add entries to your LDAP directory with ldapadd or with a script.
7. Use ldapsearch to see if slapd is working.
8. At this point, your LDAP directory should exist. The next step is to configure
your LDAP-enabled applications so that they can use the LDAP directory.
8.9 Configuring Your System to Authenticate Using
OpenLDAP
This section provides a brief overviewof howto configure your Red Hat Linux system
to authenticate using OpenLDAP. Unless youre an OpenLDAP expert, you will probably
need more documentation than is provided here. Please refer to the references pro-
vided in Section 8.10, LDAP Resources on the Web for more information.
8.9.1 Install the Necessary LDAP Packages
First, youll need to make sure that the appropriate packages are installed on both the
LDAP server and the LDAP client machines. The LDAP server needs the openldap
package.
The LDAP client machines need the following packages installed: openldap,
auth_ldap, nss_ldap and pam_ldap.
8.9.2 Edit Configuration Files
Edit /etc/openldap/slapd.conf
The slapd.conf file, located in /etc/openldap, contains the configuration
information needed by your slapd LDAP server. Youll need to edit this file to
make it specific to your domain and your server.
The suffix line names the domain for which the LDAP server will provide informa-
tion. The suffix line should be changed from:
suffix "dc=your-domain, dc=com"
so that it reflects your domain name. For example:
190 Chapter 8:Lightweight Directory Access Protocol (LDAP)
suffix "dc=acmewidgets, dc=com"
or
suffix "dc=acmeuniversity, dc=org"
The rootdn entry is the DN for a user who is unrestricted by the access control or
administrative limit parameters set for operations on the LDAP directory. The rootdn
user can be thought of as the root user for the LDAP directory. The rootdn line needs
to be changed from:
rootdn "cn=root, dc=your-domain, dc=com"
to something like:
rootdn "cn=root, dc=redhat, dc=com"
or
rootdn "cn=ldapmanager, dc=my_organization, dc=org"
Change the rootpw line from:
rootpw secret
to something like
rootpw {crypt}s4L9sOIJo4kBM
In the above example, youre using an encrypted root password, which is a much
better idea than leaving a plain text root password in the slapd.conf file. To
make this crypt string, you should either copy it out of a passwd file, or use Perl:
perl -e "print crypt(passwd,a_salt_string);"
In the previous Perl line, salt_string is a two character salt, and passwd is the
plain text version of the password.
You could also copy a passwd entry out of /etc/passwd, but this wont work if
the passwd entry is an MD5 password (the default in Red Hat Linux 6.2).
Edit ldap.conf
Edit the ldap.conf files in /etc and in /etc/openldap on the LDAP server
and clients.
Section 8.9:Configuring Your System to Authenticate Using OpenLDAP 191
Edit /etc/ldap.conf, the configuration file for nss_ldap and pam_ldap, to
reflect your organization and search base. The file /etc/openldap/ldap.conf
is the configuration file for the command line tools like ldapsearch, ldapadd,
etc., and it will also need to be edited for your LDAP setup. Client machines will
need to have both of these files modified for your system.
Edit /etc/nsswitch.conf
To use nss_ldap, youll need to add ldapto the appropriate fields in /etc/nss-
witch.conf. (Be very careful when editing this file; be sure that you know what
youre doing.) For example:
passwd: files ldap
shadow: files ldap
group: files ldap
Copy the PAM Configuration Files
To use pam_ldap, youll need to copy the PAM configuration files from
/usr/doc/nss_ldap<version>/pam.d/ to your /etc/pam.d/ direc-
tory. These are a set of PAM configuration files that allow all of the standard
PAM-enabled applications to use LDAP for authentication. (PAM is beyond the
scope of this LDAP overview, so if you need help, consult Section 2.6, User
Authentication with PAM and/or PAM man pages.)
8.9.3 Migrate Your Old Authentication Information to LDAP
Format
The /usr/share/openldap/migration directory contains a set of shell and
Perl scripts for migrating your old authentication information into LDAP format.
(Yes, youll need to have Perl on your system to use these scripts.)
First, youll need to modify the migrate_common.ph file so that it reflects your
domain. The default DNS domain should be changed from:
$DEFAULT_MAIL_DOMAIN = "padl.com";
to something like:
$DEFAULT_MAIL_DOMAIN = "your_company.com";
The default base should also be changed, from:
192 Chapter 8:Lightweight Directory Access Protocol (LDAP)
$DEFAULT_BASE = "dc=padl,dc=com";
to something like:
$DEFAULT_BASE = "dc=your_company,dc=com";
Next, youll need to decide which script to use. The following table should tell you:
Table 81 LDAP Migration Scripts
Existing name service Is LDAP running? Use this script:
/etc flat files yes migrate_all_on-
line.sh
/etc flat files no migrate_all_of-
fline.sh
NetInfo yes migrate_all_net-
info_online.sh
NetInfo no migrate_all_net-
info_offline.sh
NIS (YP) yes mi-
grate_all_nis_on-
line.sh
NIS (YP) No mi-
grate_all_nis_of-
fline.sh
Run the appropriate script based on your existing name service.
The README and the migration-tools.txt files in /usr/share/openl-
dap/migration provide more details.
8.10 LDAP Resources on the Web
Lots of useful information about LDAP can be found on the Web. Please reviewthese
sources, especially the OpenLDAP website and the LDAP HOWTO, before you start to
set up LDAP on your system.
Section 8.10:LDAP Resources on the Web 193
OpenLDAP
http://www.openldap.org
University of Michigan
http://www.umich.edu/~dirsvcs/ldap/
The SLAPD and SLURPD Administrators Guide
http://www.umich.edu/~dirsvcs/ldap/doc/guides/slapd
Innosoft/Critical Angle
http://www.innosoft.com/ldapworld
Jeff Hodges LDAP Road Map and FAQ
http://www.kingsmountain.com/ldapRoadmap.shtml
PADL (nss_ldap, pam_ldap and ypldapd)
http://www.padl.com/
auth_ldap
http://www.rudedog.org/auth_ldap/1.4/auth_ldap.html
The LDAP HOWTO
http://www.linuxdoc.org/HOWTO/LDAP-HOWTO.html
Sendmail 8.[89].x using LDAP to do address lookups
http://www.stanford.edu/~bbense/Inst.html
Using a personal LDAP server, the Apache Web server and PHP to manage your
personal e-mail addressbook
http://www.webtechniques.com/archives/1999/05/junk/junk.shtml
Also, remember that man pages exist for the various LDAP daemons and utilities.
Please check the man pages if you need more information.
194 Chapter 8:Lightweight Directory Access Protocol (LDAP)
Part II Installation-Related Reference
Section 9.1:Th
Hat Linux Installation the end of thee You gin in theficial Hat Linux Installation Guide a table for you to fill with your specific systemrequirements, which will help keep up with any will need during your
198 Chapter 9:Preparing for a Text Mode Installation
9.1.1 Basic Hardware Configuration
You should have a basic understanding of the hardware installed in your computer,
including:
hard drive(s) -- Specifically, the number, size, and type. If you have more than
one, its helpful to know which one is first, second, and so on. It is also good to
know if your drives are IDE or SCSI. If you have IDE drives, you should check
your computers BIOS to see if you are accessing them in linear mode. Please
refer to your computers documentation for the proper key sequence to access
the BIOS. Note that your computers BIOS may refer to linear mode by other
names, such as "large disk mode." Again, your computers documentation should
be consulted for clarification.
memory -- The amount of RAM installed in your computer.
CD-ROM -- Most importantly, the units interface type (IDE, SCSI, or other
interface) and, for non-IDE, non-SCSI CD-ROMs, the make and model number.
IDE CD-ROMs (also known as ATAPI) are the most common type in recently
manufactured, PC-compatible computers.
SCSI adapter (if one is present) -- The adapters make and model number.
network card (if one is present) -- The cards make and model number.
mouse -- The mouses type (serial, PS/2, or bus mouse), protocol (Microsoft,
Logitech, MouseMan, etc.), and number of buttons; also, for serial mice, the serial
port it is connected to.
On many newer systems, the installation program is able to automatically identify
most hardware. However, its a good idea to collect this information anyway, just to
be sure.
Learning About Your Hardware with Windows
If your computer is already running Windows 9x, you can use the following procedure
to get additional configuration information:
Section 9.1:Things You Should Know 199
Figure 91 Windows System Properties
In Windows, click on the My Computer icon using the secondary (normally the
right) mouse button. A pop-up menu should appear.
Select Properties. The System Properties window should appear. Note the infor-
mation listed under Computer -- in particular the amount of RAM listed.
Click on the Device Manager tab. You will then see a graphical representation
of your computers hardware configuration. Make sure the View devices by type
button is selected.
At this point, you can either double-click on the icons (or single-click on the plus
sign +) to look at each entry in more detail. Look under the following icons for more
information:
200 Chapter 9:Preparing for a Text Mode Installation
Figure 92 Device Manager Under Windows 95
Disk drives -- You will find the type (IDE or SCSI) of hard drive here. (IDE drives
will normally include the word "IDE," while SCSI drives wont.)
Hard disk controllers -- You can get more information about your hard drive con-
troller here.
CDROM -- Here is where youll find out about any CD-ROM drives connected to
your computer.
Section 9.1:Things You Should Know 201
Please Note
In some cases, there may be no CD-ROM icon, yet your
computer has a functioning CD-ROM drive. This is
normal, depending on how Windows was originally in-
stalled. In this case, you may be able to learn additional
information by looking at the CD-ROM driver loaded in
your computers config.sys file.
Mouse -- The type of mouse present on your computer can be found here.
Display adapters -- If youre interested in running the X Window System, you
should write down the information you find here.
Sound, video and game controllers -- If your computer has sound capabilities, youll
find more information about that here.
Network adapters -- Here youll find additional information on your computers
network card (if you have one).
SCSI controllers -- If your computer uses SCSI peripherals, youll find additional
info on the SCSI controller here.
While this method is not a complete substitute for opening your computers case
and physically examining each component, in many cases it can provide sufficient
information to continue with the installation.
Please Note
This information can also be printed by clicking on the
Print button. A second window will appear, allowing you
to choose the printer, as well as the type of report (the
All Devices and System Summary report type is the most
complete).
202 Chapter 9:Preparing for a Text Mode Installation
9.1.2 Video Configuration
If you will be installing the X Window System, you should also be familiar with the
following:
your video card -- The cards make and model number (or the video chipset it
uses), and the amount of video RAM it has. (Most PCI-based cards are auto-
detected by the installation program.)
your monitor -- The units make and model number, along with allowable ranges
for horizontal and vertical refresh rates. (Newer models may be auto-detected by
the installation program.)
9.1.3 Network-related Information
If youre connected to a network, be sure you know the following:
IP address -- Usually represented as a set of four numbers separated by dots, such
as 10.0.2.15.
netmask -- Another set of four numbers separated by dots. An example netmask
would be 255.255.248.0.
gateway IPaddress -- Yet another set of four dot-separated numbers. For instance,
10.0.2.254.
one or more name server IP addresses -- One or more sets of dot-separated num-
bers. For example, 10.0.2.1 might be the address of a name server.
domain name -- The name your organization uses. For instance, Red Hat has a
domain name of redhat.com.
hostname -- The name assigned to your individual system. A computer might be
named pooh, for instance.
Section 9.1:Things You Should Know 203
Please Note
The information given above is an example only! Do not
use it when you install Red Hat Linux! If you dont know
the proper values for your network, ask your network ad-
ministrator.
204 Chapter 9:Preparing for a Text Mode Installation
Section 10.1:The Installation Program User Interface 205
10 Installing Red Hat Linux via Text Mode
This release of Red Hat Linux features a graphical, mouse-based installation program,
documented in the Official Red Hat Linux Installation Guide. But you can also install
Red Hat Linux with a text mode, keyboard-based installation program. This chapter
explains how to use it. Here are some recommendations:
If youre new to Linux installations, read the Official Red Hat Linux Installation
Guide first. Although it focuses on the graphical installation process, most of the
concepts apply to the text mode installation as well. After that, youll find that
Chapter 9, Preparing for a Text Mode Installation, Preparing for a Text Mode
Installation, will give you more in-depth information regarding those aspects of
installing Red Hat Linux that do not apply to the graphical installation process.
Additionally, youll find Appendix B, An Introduction to Disk Partitions, An In-
troduction to Disk Partitions, helpful, as it discusses disk partition resizing (cru-
cial if you plan to install Linux on a disk where another operating system is cur-
rently installed).
If youll need PCMCIA support to perform the installation (for example, youre
installing on a laptop equipped with a PCMCIAcard), you must make a PCMCIA
boot disk. The Official Red Hat Linux Installation Guide explains how to do this.
If you plan to install over a network (via NFS, FTP, or HTTP), you must make a
network boot disk. The Official Red Hat Linux Installation Guide explains how
to do this.
If youve never used the text mode installation program, or need a refresher on
its user interface, read the next section.
To begin installation without further delay, turn to Section 10.2, Starting the
Installation Program.
10.1 The Installation Program User Interface
The Red Hat Linux text mode installation program uses a screen-based interface that
includes most of the on-screen "widgets" commonly found on graphical user inter-
faces. Figure 101, Installation Program Widgets as seen in Configure TCP/IP and
206 Chapter 10:Installing Red Hat Linux via Text Mode
Figure 102, Installation Program Widgets as seen in Disk Druid illustrate the screens
youll see.
Figure 101 Installation Program Widgets as seen in Configure TCP/IP
Section 10.1:The Installation Program User Interface 207
Figure 102 Installation Program Widgets as seen in Disk Druid
Heres a list of the most important widgets shown in Figure 101, Installation Pro-
gram Widgets as seen in Configure TCP/IP and Figure 102, Installation Program Wid-
gets as seen in Disk Druid :
Window -- Windows (usually referred to as dialogs in this manual) will appear
on your screen throughout the installation process. At times, one window may
overlay another; in these cases, you can only interact with the window on top.
When you are finished in that window, it will disappear, allowing you to continue
working in the window underneath.
Text Input -- Text input lines are regions where you can enter information required
by the installation program. When the cursor rests on a text input line, you may
enter and/or edit information on that line.
Check Box -- Check boxes allow you to select or deselect a feature. The box
displays either an asterisk (selected) or a space (unselected). When the cursor is
208 Chapter 10:Installing Red Hat Linux via Text Mode
within a check box, press [Space] to select an unselected feature or to deselect a
selected feature.
Text Widget -- Text widgets are regions of the screen for the display of text. At
times, text widgets may also contain other widgets, such as check boxes. If a text
widget contains more information than can be displayed in the space reserved
for it, a scroll bar appears; if you position the cursor within the text widget, you
can then use the [Up] and [Down] arrow keys to scroll through all the information
available. Your current position is shown on the scroll bar by a # character, which
moves up and down the scroll bar as you scroll.
Button Widget -- Button widgets are the primary method of interacting with
the installation program. You progress through the windows of the installation
program by navigating these buttons, using the [Tab] and [Enter] keys. Buttons can
be selected when they are highlighted.
Cursor -- Although not a widget, the cursor is used to select (and interact) with
a particular widget. As the cursor is moved from widget to widget, it may cause
the widget to change color, or you may only see the cursor itself positioned in or
next to the widget. In Figure 101, Installation Program Widgets as seen in Con-
figure TCP/IP, the cursor is positioned on the OK button. Figure 102, Installation
Program Widgets as seen in Disk Druid shows the cursor on the Edit button.
10.1.1 Using the Keyboard to Navigate
Navigation through the installation dialogs is performed through a simple set of key-
strokes. To move the cursor, use [Left], [Right], [Up], and [Down] arrow keys. Use [Tab],
and [Alt]-[Tab] to cycle forward or backward through each widget on the screen. Most
screens display along the bottom a summary of available cursor positioning keys.
To "press" a button, position the cursor over the button (using [Tab], for instance) and
press [Space] or [Enter]. To select an item from a list of items, move the cursor to the
itemyou wish to select and press [Enter]. To select an itemwith a check box, move the
cursor to the check box and press [Space] to select an item. To deselect, press [Space]
a second time.
Pressing [F12] accepts the current values and proceeds to the next dialog; it is equiva-
lent to pressing the OK button.
Section 10.2:Starting the Installation Program 209
CAUTION
Unless a dialog box is waiting for your input, do not press
any keys during the installation process (doing so may result
in unpredictable behavior).
10.2 Starting the Installation Program
There are several ways to start the installation. You can:
insert the diskette included in your boxed set (or a PCMCIAboot or network boot
disk that youve created) into the primary diskette drive and reboot your computer
insert the Red Hat Linux CD into the drive and reboot, if your computer can boot
from the CD-ROM drive
boot MS-DOS, and start a program in the dosutils directory of the Red Hat
Linux CD-ROM named autoboot.bat (this will work from DOS only; it will
not work from a DOS window started from Windows)
While the installation program loads, messages will scroll on your screen. When the
installation program has loaded, this prompt appears:
boot:
10.2.1 Displaying Online Help
Once the installation program is loaded into memory, you can obtain information
about the installation process and options by pressing [F1] through [F6]. For example,
press [F2] to see general information about the online help screens.
10.2.2 Text Mode Boot Options
If you press [Enter] at the boot prompt, or if you take no action within the first minute
after the boot prompt appears, the graphical installation program, as explained in
the Official Red Hat Linux Installation Guide, starts. Pressing one of the help screen
function keys as described above disables this autostart feature.
210 Chapter 10:Installing Red Hat Linux via Text Mode
To start the text mode installation program explained here, before pressing [Enter],
type:
boot: text
If the installation program does not properly detect your hardware, you may need to
restart the installation in "expert" mode. To start an expert mode installation, type:
boot: text expert
Expert mode disables most hardware probing, and gives you the option of entering
options for the drivers loaded during the installation.
Please Note
The initial boot messages will not contain any references
to SCSI or network cards. This is normal; these devices are
supported by modules that are loaded during the installation
process.
Note that the command to start a serial installation has changed. If you must perform
the installation in serial mode, type:
boot: linux console=<device>
Where <device> should be the device you are using (such as ttyS0 or ttyS1).
Other options that may be entered with the boot command include passing options
to the kernel. For example, to instruct the kernel to use all the RAM in a 128 MB
system, enter:
boot: linux mem=128M
Section 10.4:Selecting a Keyboard Type 211
10.3 Choosing a Language
Using the [Up] and [Down] arrow keys, select the appropriate language for both the
installation program and the system default, and press [Enter] (Figure 103, Selecting
a Language).
Figure 103 Selecting a Language
A scroll bar appears to the right of the list. This indicates that there are more entries
than can be displayed in the available space at once. Youll see other scroll bars like
this throughout the installation program.
10.4 Selecting a Keyboard Type
Next, choose a keyboard type (Figure 104, Selecting a Keyboard Type).
212 Chapter 10:Installing Red Hat Linux via Text Mode
Figure 104 Selecting a Keyboard Type
After selecting the appropriate keyboard type, press [Enter]; the keyboard type you
select will be loaded automatically both for the remainder of the installation process
and each time you boot your Red Hat Linux system.
Tip
If you wish to change your keyboard type after you have
installed your Red Hat Linux system, become root and type
either /usr/sbin/kbdconfig or setup at the root
prompt.
10.5 Selecting an Installation Method
If you booted directly from the Red Hat Linux CD-ROM, youll see the Welcome
dialog: turn to Section 10.8, Welcome.
Section 10.5:Selecting an Installation Method 213
Otherwise, an Installation Method dialog appears. The choices presented in the dialog
vary depending on the type of diskette you booted from (the one in your boxed set,
or a network or PCMCIA boot disk that you created).
Figure 105, Installation Method Dialog shows all available choices.
Figure 105 Installation Method Dialog
Please Note
If you are performing a network installation and are copying
the files from the Red Hat Linux CD-ROM or an FTP site,
be sure to check the file permissions to make sure they are
set correctly for your installation. If you do not, the files
that you copy will not be executable and you will have to
change the permissions before you are able to install.
Red Hat Linux can be installed via any of the following:
214 Chapter 10:Installing Red Hat Linux via Text Mode
Local CDROM
If you booted from the diskette in your boxed set and are installing with the
Red Hat Linux CD-ROM in a local drive. If you choose this method, youll
next see the Welcome dialog: turn to Section 10.8, Welcome.
NFS Image
If you booted from a network or PCMCIA boot disk and are installing from
an NFS Image server which is exporting the Red Hat Linux CD-ROM (or a
mirror image of one.) If you choose this method, youll next see the NFS Setup
dialogs: turn to Section 10.7, Installing over a Network.
FTP
If you booted from a network or PCMCIA boot disk and are installing directly
from an FTP server. If you select this method, youll next see the FTP Setup
dialogs: turn to Section 10.7, Installing over a Network.
HTTP
If you booted from a network or PCMCIA boot disk and are installing directly
from an HTTP Web server. If you select this method, youll next see the HTTP
Setup dialogs: turn to Section 10.7, Installing over a Network.
Hard Drive
If you booted from the diskette in your boxed set and are installing from the
Red Hat Linux files that you have previously copied to a local hard drive. If
you select this method, youll next see the Select Partition dialog: turn to Section
10.6, Identify Disk Partition to Install From.
10.6 Identify Disk Partition to Install From
The Select Partition screen (Figure 106, Selecting Partition Dialog for Hard Drive
Installation) applies only if you are installing from a disk partition (that is, if you
selected Hard Drive in the Installation Method dialog). This dialog allows you to name
the disk partition you are installing from.
Section 10.7:Installing over a Network 215
Figure 106 Selecting Partition Dialog for Hard Drive Installation
Enter the device name of the partition containing the RedHat directory tree. There is
also a field labelled Directory holding Red Hat. If the RedHat directory is not in the root
directory of that partition, enter the path to the RedHat directory (for example, if the
RedHat directory is at /test/new/RedHat, you would enter /test/new).
After youve identified the disk partition, youll next see the Welcome dialog: Turn
now to Section 10.8, Welcome.
10.7 Installing over a Network
If you are performing a network installation, the Configure TCP/IP dialog appears; for
an explanation of this dialog, go to Section 10.13, Configuring a Network Connection
and then return here.
216 Chapter 10:Installing Red Hat Linux via Text Mode
10.7.1 NFS Setup
The NFS setup dialog (Figure 107, NFS Setup Dialog) applies only if you are in-
stalling from an NFS server (that is, if you booted from a network or PCMCIA boot
disk and selected NFS Image in the Installation Method dialog).
Figure 107 NFS Setup Dialog
Enter the fully-qualified domain name or IP address of your NFS server, and the
name of the exported directory that contains the Red Hat Linux installation files or
CD. For example, if youre installing from a host named eastcoast in the domain
redhat.com, enter eastcoast.redhat.com in the NFS Server field.
If the NFS server has the Red Hat Linux CD mounted on /mnt/cdrom, enter
/mnt/cdrom in the Red Hat directory field. If the NFS server is exporting a mirror
of the Red Hat Linux installation tree instead of a CD, enter the directory which con-
tains the RedHat directory. For example, if your NFS server contains the directory
/mirrors/redhat/i386/RedHat, enter /mirrors/redhat/i386.
Section 10.7:Installing over a Network 217
Please Note
If you are performing an NFS installation and are copying
the files fromthe Red Hat Linux CD-ROM, be sure to check
the file permissions to make sure they are set correctly for
your installation. If you do not, the files that you copy will
not be executable and you will have to change the permis-
sions before you are able to install.
Next youll see the Welcome dialog: Turn now to Section 10.8, Welcome.
10.7.2 FTP Setup
The FTP Setup screen (Figure 108, FTP Setup Diallog) applies only if you are in-
stalling from an FTP server (that is, if you selected FTP in the Installation Method dia-
log). This dialog allows you to identify the FTP server you are installing from.
Figure 108 FTP Setup Diallog
218 Chapter 10:Installing Red Hat Linux via Text Mode
Enter the fully-qualified domain name or IP address of the FTP site you are in-
stalling from, and the name of the directory there which contains the RedHat in-
stallation files for your architecture. For example, if the FTP site contains the direc-
tory /pub/mirrors/redhat/i386/RedHat, enter /pub/mirrors/red-
hat/i386.
If everything has been specified properly, a message box appears indicating that
base/hdlist is being retrieved.
Next youll see the Welcome dialog: Turn now to Section 10.8, Welcome.
10.7.3 HTTP Setup
The HTTP Setup screen (Figure 109, HTTP Setup Dialog) applies only if you are
installing from an HTTP server (that is, if you selected HTTP in the Installation Method
dialog). This dialog prompts you for information about the HTTP server you are
installing from.
Figure 109 HTTP Setup Dialog
Section 10.8:Welcome 219
Enter the name or IP address of the HTTP site you are installing from, and the name
of the directory there which contains the RedHat installation files for your architec-
ture. For example, if the HTTP site contains the directory /pub/mirrors/red-
hat/i386/RedHat, enter /pub/mirrors/redhat/i386.
If everything has been specified properly, a message box appears indicating that
base/hdlist is being retrieved.
Next youll see the Welcome dialog: Turn now to Section 10.8, Welcome.
10.8 Welcome
Once youve selected your language and keyboard, and indicated the installation
method, Figure 1010, Welcome dialog appears. Press OK to continue.
Figure 1010 Welcome dialog
220 Chapter 10:Installing Red Hat Linux via Text Mode
10.9 Upgrading or Installing
The Installation Type dialog (Figure 1011, Installation Type Dialog) presents you with
five choices, described below.
Figure 1011 Installation Type Dialog
Install GNOME Workstation -- Install on a system that will be used primarily as a
workstation. Load the GNOME GUI and configure the system to start GNOME
when the system boots. The installation program deletes all data in any exist-
ing Linux partitions, decides how to partition the disk for the new version, and
chooses which software packages to load.
Section 10.9:Upgrading or Installing 221
WARNING
Do not choose this method if youre sharing a disk
with Windows NT; if you do, you will be unable to
boot Windows NT. LILO will write over NTs boot
loader and you will be unable to boot NT. You must
perform a custom-class installation and configure
LILO so that it is not installed on the Master Boot
Record (MBR).
To create a dual-boot environment on a system
that currently has NT, you must install LILO
on the first sector of the root partition, not the
MBR. Please be sure to create a boot disk. In
a case such as this, you will either need to use
the boot disk, or configure the NT system loader
to boot LILO from the first sector of the root
partition. Be sure to check out http://www.linux-
doc.org/HOWTO/mini/Linux+NT-Loader.html for
more information on setting up LILO and NT.
Install KDE Workstation -- Install on a system that will be used primarily as a work-
station. Load the KDE GUI and configure the system to start KDE when the
system boots. The installation program deletes all data in any existing Linux par-
titions, decides how to partition the disk for the new version, and chooses which
software packages to load.
222 Chapter 10:Installing Red Hat Linux via Text Mode
WARNING
Do not choose this method if youre sharing a disk
with Windows NT; if you do, you will be unable to
boot Windows NT. LILO will write over NTs boot
loader and you will be unable to boot NT. You must
perform a custom-class installation and configure
LILO so that it is not installed on the Master Boot
Record (MBR).
To create a dual-boot environment on a system
that currently has NT, you must install LILO
on the first sector of the root partition, not the
MBR. Please be sure to create a boot disk. In
a case such as this, you will either need to use
the boot disk, or configure the NT system loader
to boot LILO from the first sector of the root
partition. Be sure to check out http://www.linux-
doc.org/HOWTO/mini/Linux+NT-Loader.html for
more information on setting up LILO and NT.
Install Server System -- Install on a system that will be used primarily as a server.
The X Window System is not configured and no GUI starts when the system
boots. The Installation program deletes all data in all existing partitions of any
kind, decides how to partition the disk for the new version, and chooses which
software packages to load.
Install Custom System -- Perform a custom installation. You make all decisions
regarding disk partitioning and initialization, which software packages to install,
and how to configure the X Window System and the user interface.
Section 10.9:Upgrading or Installing 223
Upgrade Existing System -- Upgrade an earlier version of Red Hat Linux (2.0 or
later) without deleting any existing data. The installation program updates the
modular 2.2.x kernel and all currently installed software packages.
10.9.1 Upgrading
If you choose to upgrade and the installation program detects more than one installed
Linux version on the system, youll be asked which version to upgrade. After you in-
dicate this, or if theres only one installed Linux version on the system, the installation
program probes your existing system to determine which software packages require
updating and presents the Customize Packages to Upgrade dialog (Figure 1012, Cus-
tomize Packages to Upgrade Dialog).
Figure 1012 Customize Packages to Upgrade Dialog
If you answer No, the installation program starts upgrading existing packages.
Answer Yes if you want to add to or remove items from the list of individual packages
to be upgraded. The package selection dialog is seen in Section 10.19.1, Selecting
Individual Packages. The upgrade starts when you finish making your changes.
224 Chapter 10:Installing Red Hat Linux via Text Mode
Please Note
Some upgraded packages may require that other packages
are also installed for proper operation. The upgrade proce-
dure takes care of these dependencies, but in doing so it
may need to install additional packages which are not on
your existing system.
The upgrade process preserves existing configuration files by renaming them using
a .rpmsave extension (e.g., sendmail.cf.rpmsave) and leaves a log telling
what actions it took in /tmp/upgrade.log. As software evolves, configuration
file formats can change, so you should carefully compare your original configuration
files to the new files before integrating your changes.
The next dialog youll see is Figure 1040, Package Installation Status Dialog. This
dialog remains on the screen until the upgrade is complete.
10.9.2 Installing
If you choose a workstation- or server-class installation, Figure 1013, Automatic
Partitioning Dialog appears.
Section 10.9:Upgrading or Installing 225
Figure 1013 Automatic Partitioning Dialog
If you select Continue and press OK, the installation program partitions your disk and
decides which software packages to install. Next, youll see the Hostname dialog
explained in Section 10.12, Naming Your Computer.
If you select Manually partition or choose to perform a custom-class installation, Disk
Druid will begin. The disk partitioning dialogs described in the next section will ap-
pear, showing you any current partitions on your system. It is up to you to indicate
the partitions and mount points to be used for installation of this version of Red Hat
Linux.
226 Chapter 10:Installing Red Hat Linux via Text Mode
CAUTION
Installing Red Hat Linux over another installation of Linux
(including Red Hat Linux) does not preserve any informa-
tion (files or data) from the prior installation. Make sure
you save any important files! If you are worried about sav-
ing the current data on your existing Red Hat Linux system
(without making a backup on your own), you should con-
sider performing an upgrade instead.
10.10 Partitioning Your Disk for Red Hat Linux
If you have not yet planned how you will set up your partitions, turn to Appendix
B, An Introduction to Disk Partitions. There youll find an introduction to basic disk
partitioning concepts. As a bare minimum, youll need an appropriately-sized root
partition, and a swap partition of at least 16 MB.
Figure 1014, Disk Setup Dialog shows the two disk partitioning applications that
are available for you to use.
If you will be using fdisk to partition your drive, please see Section 10.10.11, Using
fdisk for those instructions. If you select Disk Druid, continue reading below.
Section 10.10:Partitioning Your Disk for Red Hat Linux 227
Figure 1014 Disk Setup Dialog
The following sections describe the layout of Figure 1015, Disk Druid Main Screen
and how to use its buttons to set up partitions. If youre already familiar with Disk
Druid, you can partition your disk and skip to Section 10.10.10, Choose Partitions to
Format Dialog.
You use the disk partitioning dialogs to tell the installation program where to install
Red Hat Linux (Figure 1015, Disk Druid Main Screen).
228 Chapter 10:Installing Red Hat Linux via Text Mode
Figure 1015 Disk Druid Main Screen
10.10.1 The Current Disk Partitions Section
Each line in the Current Disk Partitions section represents a disk partition. In this ex-
ample (Figure 1015, Disk Druid Main Screen), there are Linux existing partitions.
Note the scroll bar to the right, which indicates that there may be more partitions than
can be displayed at one time. If you use the [Up] and [Down] arrow keys, you can see if
there are any additional partitions. Each line in this section has five different fields:
Mount Point -- Indicates where the partition will be mounted when Red Hat Linux
is installed (such as /, /boot, or swap).
Device -- Displays specific hard drive and partition information.
Requested -- Shows the partitions initial size.
Actual -- Shows the partitions current size.
Type -- Shows the partitions type.
Section 10.10:Partitioning Your Disk for Red Hat Linux 229
As you scroll through the Current Disk Partitions section, you might see an Unallo-
cated Requested Partitions title bar, followed by one or more partitions.
These are partitions that have been requested but, for one reason or another, have not
been allocated. A common reason for having an unallocated partition is a lack of
sufficient free space for the partition. In any case, the reason the partition remains
unallocated will be displayed after the partitions mount point.
10.10.2 The Drive Summaries Section
Each line in the Drive Summaries section represents a hard disk on your system. Each
line has the following fields:
Drive -- Shows the hard disks device name.
Geom [C/H/S] -- Shows the hard disks geometry. The geometry consists of three
numbers representing the number of cylinders, heads and sectors as reported by
the hard disk.
Total -- Shows the total available space on the hard disk.
Used -- Shows how much of the hard disks space is currently allocated to parti-
tions.
Free -- Shows how much of the hard disks space is still unallocated.
Bar Graph -- Presents a visual representation of the space currently used on the
hard disk. The more pound signs there are between the square braces, the less free
space there is. In Figure 1015, Disk Druid Main Screen, the bar graph shows no
free space.
Please Note
The Drive Summaries section is displayed only to indicate
230 Chapter 10:Installing Red Hat Linux via Text Mode
10.10.3 Disk Druids Buttons
These buttons control Disk Druids actions. They are used to add and delete partitions,
and to change partition attributes. In addition, there are buttons that are used to accept
the changes youve made, or to exit Disk Druid entirely. Lets take a look at each button
in order.
Add -- Request a newpartition. Selecting this button causes a dialog box to appear
containing fields that must be filled in.
Edit -- Modify the mount point of the partition currently highlighted in the Current
Disk Partitions section. Selecting this button will cause a dialog box to appear
allowing you to change the name of the mount point.
Delete -- Delete the partition currently highlighted in the Current Disk Partitions
section. Selecting this button will cause a dialog box to appear asking you to
confirm the deletion.
OK -- Confirmthat changes made to your systems partitions to be written to disk.
You will be asked to confirm the changes before Disk Druid rewrites your hard disk
partition table(s). In addition, any mount points youve defined are passed to the
installation program, and will eventually be used by your Red Hat Linux system
to define the filesystem layout.
Back -- Abort without saving any changes youve made. When this button is
selected, the installation program will take you back to the previous screen, so
you can start over.
10.10.4 Handy Function Keys
Use the [F5] (Reset) function key to discard all changes you may have made while in
Disk Druid, and return the list of partitions to those read from the partition table(s) on
your hard disk(s). When selected, youll be asked to confirm whether you want to
discard the changes. Note that any mount points youve specified will be lost, and
will need to be reentered.
Section 10.10:Partitioning Your Disk for Red Hat Linux 231
Please Note
You will need to dedicate at least one partition to Red Hat
Linux, and optionally more. This is discussed more com-
pletely in Section B.1.8, How Many Partitions?.
10.10.5 Adding a Partition
To add a new partition, select the Add button and press [Space] or [Enter]. The Edit New
Partition dialog (Figure 1016, Edit New Partition Dialog) appears.
Figure 1016 Edit New Partition Dialog
The screen contains the following fields:
Mount Point -- Highlight this field and enter the partitions mount point. For ex-
ample, if this partition should be the root partition, enter /; enter /usr for the
/usr partition, and so on.
232 Chapter 10:Installing Red Hat Linux via Text Mode
Size (Megs) -- In this field, enter the size (in megabytes) of the partition. Note that
this field starts with a "1" in it, meaning that unless you change it, youll end up
with a 1 MB partition. Delete it using the [Backspace] key, and enter the desired
partition size.
Grow to fill disk? -- This check box indicates whether the size you entered in the
previous field is to be considered the partitions exact size, or its minimum size.
Press [Space] to select this option. When selected, the partition will grow to fill
oabo -- This field cotaiois a of the disis i(stlleld)3395ion yorewith a check box (or)-510eachn. a disns box checked, thon this
partition be that disn. using d(f)20fderntf check box
you hIn drlect
to partitiois you fit, or dcsid5
Intel
The following partition is specific to Red Hat Linux/In-
tel installations.
A /boot partition -- The partition mounted on /boot
contains the operating systemkernel (which allows your
system to boot Red Hat Linux), along with a few other
files used during the bootstrap process. Due to the limi-
tations of most PC BIOSes, creating a small partition to
hold these files is a good idea. This partition should be
no larger than 16MB.
Please Note
Make sure you read Section B.1.9, One Last Wrinkle:
Using LILO -- the information there applies to the
/boot partition!