Configuration files are another mainstay of Linux administration. Almost everything you set up for your particular computer — user accounts, network addresses, or GUI preferences — is stored in plain−text files. This has some advantages and some disadvantages.
The advantage of plain−text files is that it is easy to read and change them. Any text editor will do. On the downside, however, is that as you edit configuration files, no error checking is going on. You have to run the program that reads these files to find out if you set up the files correctly. A comma or a quote in the wrong place can sometimes cause a whole interface to fail.
There are several locations in the Red Hat Linux file system where configuration files are stored. Here are some of the major locations:
$HOME — All users store information in their home directories that directs how their login accounts behave. Most configuration files begin with a dot (.), so they don’t appear as a user’s directory when you use a standard ls command (you need to type ls −a to see them). There are dot files that define how each user’s shell behaves, the look and feel of the desktop, and what options are used with your text editor. There are even files (such as .rhosts) that configure network permissions for each user.
/etc — This contains many of the most basic Linux system configuration files.
Here are some /etc configuration files that are of interest:
aliases — Can contain distribution lists used by the Linux mail service.
crontab — Sets cron environment and times for running automated tasks.
exports — Contains a list of local directories that are available to be shared by remote computers using the Network File System (NFS).
fstab — Identifies the devices for common storage media (hard disk, floppy, CD−ROM, etc.) and locations where they are mounted in the Linux system. This is used by the mount command to choose which file systems to mount.
group — Identifies group names and group IDs (GIDs) that are defined on the systems. Group
permissions in Red Hat Linux are defined by the second of three sets of rwx (read, write, execute) bits associated with each file and directory.
host.conf — Sets the locations in which domain names (e.g., redhat.com) are searched for on TCP/IP networks (such as the Internet). By default, the local hosts file is searched, then any nameserver entries in resolv.conf.
hosts — Contains IP addresses and hostnames that you can reach from your computer. (Usually this file is used just to store names of computers on your LAN or larger private network.)
xinetd.conf — Contains simple configuration information used by the xinetd daemon process.
This file mostly points to the /etc/xinetd.d directory for information about individual services (described later).
info−dir — Contains the top heading for information that is available from the info command.
inittab — Contains information that defines what programs start and stop when Red Hat Linux boots, shuts down, or goes into different states in between.
lilo.conf — Sets various parameters used by the Linux boot loader (lilo) to boot your Linux system. In particular, it lists information about the bootable partitions on your computer. (If you are using grub, which has replaced lilo as the default boot manager, the lilo.conf file is not used.)
passwd — Stores account information for all valid users for the system. Also includes other information, such as the home directory and default shell.
rpmfind — Contains configuration information used by the rpmfind command to search for RPM software packages on the Internet.
services — Defines TCP/IP services and their port assignments.
shadow — Contains encrypted passwords for users that are defined in the passwd file. (This is
viewed as a more secure way to store passwords than the original encrypted password in the passwd file. The passwd file needs to be publicly readable, whereas the shadow file can be unreadable by all but the root user.)
shells — Lists the shell command line interpreters (bash, sh, csh, etc.) that are available on the system, as well as their locations.
/etc/httpd — Contains a variety of files used to configure the behavior of your Apache Web server (specifically, the httpd daemon process).
/etc/init.d — Contains the permanent copies of run−level scripts. These scripts are linked to files in the /etc/rc?.d directories to have each service associated with a script started or stopped for the particular run level. The ? is replaced by the run level number (0 through 6).
/etc/xinetd.d — Contains a set of files, each of which defines a network service that the xinetd
daemon listens for on a particular port. When the xinetd daemon process receives a request for a service, it uses the information in these files to determine which daemon processes to start to handle the request.