List of Linux Configuration File PDF
List of Linux Configuration File PDF
List of Linux Configuration File PDF
This article explains configuration files on a Linux system that control user permissions, system
applications, daemons, services, and other administrative tasks in a multi-user, multi-tasking
environment. These tasks include managing user accounts, allocating disk quotas, managing e-
mails and newsgroups, and configuring kernel parameters. This article also classifies the config
files present on a Red Hat Linux system based on their usage and the services they affect.
Every Linux program is an executable file holding the list of opcodes the CPU executes to
accomplish specific operations. For instance, the ls command is provided by the file /bin/ls, which
holds the list of machine instructions needed to display the list of files in the current directory onto
the screen. The behaviour of almost every program can be customized to your preferences or
needs by modifying its configuration files.
Most of the configuration files in the Red Hat Linux system are in the /etc directory unless
otherwise specified. The configuration files can be broadly classified into the following categories:
Access files
/etc/host.conf Tells the network domain server how to look up hostnames. (Normally /
etc/hosts, then name server; it can be changed through netconf.)
/etc/hosts Contains a list of known hosts (in the local network). Can be used if the
IP of the system is not dynamically generated. For simple hostname
resolution (to dotted notation), /etc/hosts.conf normally tells the resolver
to look here before asking the network nameserver, DNS or NIS.
/etc/redhat-release Includes one line stating the Red Hat release number and name. Used
by rc.local.
/etc/rc.d/rc Normally run for all run levels with level passed as argument. For
example, to boot your machine in the Graphics mode (X-Server), run
the following command from your command line: init 5. The runlevel
5 is starts the system in graphics mode.
/etc/rc.d/rc.sysinit Normally the first script run for all run levels.
/etc/rc.d/rc/rcX.d Scripts run from rc (X stands for any number from 1 to 5). These
directories are "run-level" specific directories. When a system starts up,
it identifies the run-level to be initiated, and then it calls all the startup
scripts present in the specific directory for that run-level. For example,
the system usually starts up and the message "entering run-level 3" is
shown after the boot messages; this means that all the init scripts in the
directory /etc/rc.d/rc3.d/ will be called.
File system
The kernel provides an interface to display some of its data structures that can be useful for
determining the system parameters like interrupts used, devices initialised, memory statistics,
etc. This interface is provided as a separate but dummy filesystem known as the /proc filesystem.
Many system utilities use the values present in this filesystemf or displaying the system statistics.
For example, the file /proc/modules lists the currently loaded modules in the system. This
information is read by the command lsmod, which then displays it in a human readable format.
In the same way, the file mtab specified in the following table reads the /proc/mount file, which
contains the currently mounted filesystems.
mount -a, which takes care of mounting every file system marked with
a "1" in the next-to-last column of fstab.
/etc/mtools.conf Configuration for all the operations (mkdir, copy, format, etc.) on a DOS-
type filesystem.
System administration
/etc/group Contains the valid group names and the users included in the specified
groups. A single user can be present in more than one group if he
performs multiple tasks. For example, is a "user" is the administrator as
well as a member of the project group "project 1", then his entry in the
group file will look like: user: * : group-id : project1
/etc/nologin If the file /etc/nologin exists, login(1) will allow access only to root. Other
users will be shown the contents of this file and their logins refused.
etc/passwd See "man passwd". Holds some user account info including passwords
(when not "shadowed").
/etc/rpmrc rpm command configuration. All the rpm command line options can be
set together in this file so that all of the options apply globally when any
rpm command is run on that system.
/etc/securetty Contains the device names of tty lines (one per line, without leading /
dev/) on which root is allowed to login.
/etc/usertty Contains the encrypted password information for users' accounts and
/etc/shadow optionally the password aging information. Included fields are:
• Login name
• Encrypted password
• Days since Jan 1, 1970 that password was last changed
• Days before password may be changed
• Days after which password must be changed
• Days before password is to expire that user is warned
• Days after password expires that account is disabled
• Days since Jan 1, 1970 that account is disabled
Networking
/etc/networks Lists names and addresses of networks accessible from the network to
which the machine is connected. Used by route command. Allows use
of name for network.
/etc/protocols Lists the currently available protocols. See the NAG (Network
Administrators Guide) and man page.
C interface is getprotoent. Should never change.
/etc/resolv.conf Tells the kernel which name server should be queried when a program
asks to "resolve" an IP Address.
/etc/rpc Contains instructions/rules for RPC, which can be used in NFS calls,
remote file system mounting, etc.
/etc/exports The file system to be exported (NFS) and permissions for it.
/etc/inetd.conf Config file for inetd. See the inetd man page. Holds an entry for
each network service for which inetd must control daemons or other
servicers. Note that services will be running, but comment them out
in /etc/services so they will not be available even if running. Format:
<service_name> <sock_type> <proto> <flags> <user> <server_path>
<args>
System commands
System commands are meant exclusively to control the system, and make everything work
properly. All the programs like login (performing the authentication phase of a user on the console)
or bash (providing the interaction between a user and the computer) are system commands. The
files associated with them are therefore particularly important. This category has the following files
of interest to users and administrators.
/etc/lilo.conf Contains the system's default boot command line parameters and also
the different images to boot with. You can see this list by pressing Tab
at the LILO prompt.
/etc/inittab This is chronologically the first configuration file in UNIX. The first
program launched after a UNIX machine is switched on is init, which
knows what to launch, thanks to inittab. It is read by init at run level
changes, and controls the startup of the main process.
/etc/termcap A database containing all of the possible terminal types and their
capabilities.
Daemons
A daemon is a program running in non-interactive mode. Typically, daemon tasks are related to the
networking area: they wait for connections, so that they can provide services through them. Many
daemons are available for Linux, ranging from Web servers to ftp servers.
/etc/syslogd.conf The configuration file for the syslogd daemon. syslogd is the daemon
that takes care of logging (writing to disk) messages coming from other
programs to the system. This service, in particular, is used by daemons
that would not otherwise have any means of signaling the presence of
possible problems or sending messages to users.
/etc/httpd.conf The configuration file for Apache, the Web server. This file is typically
not in /etc. It may be in /usr/local/httpd/conf/ or /etc/httpd/conf/, but to
make sure, you need to check the particular Apache installation.
/etc/conf.modules or /etc/modules.conf The configuration file for kerneld. Ironically, it is not the kernel "as a
daemon". It is rather a daemon that takes care of loading additional
kernel modules "on the fly" when needed.
User programs
In Linux (and UNIX in general), there are countless "user" programs. A most common user
program config file is /etc/lynx.cfg. This is the configuration file for lynx, the well-known textual
browser. Through this file you can define the proxy server, the character set to use, and so on.
The following code sample shows a part of the lynx.cfg file that can be modified to change the
proxy settings of the Linux system. These settings apply (by default) to all the users running lynx
in their respective shells, unless a user overrides the default config file by specifying --cfg =
"mylynx.cfg.
.h2 NO_PROXY
# The no_proxy variable can be a comma-separated list of strings defining
# no-proxy zones in the DNS domain name space. If a tail substring of the
# domain-path for a host matches one of these strings, transactions with that
# node will not be proxied.
.ex
no_proxy:demiurge.in.ibm.com, demiurge
The kernel
Changing configuration files in the kernel immediately affects the system. For example, changing
the passwd file to add a user immediately enables that user. Also there are some kernel tunable
parameters in the /proc/sys directory on any Linux system. The write-access to all these files is
given only to the super-user; other users have only readonly access. The files in this directory are
classified in the same manner as the Linux kernel source. Every file in this directory represents a
kernel data structure that can be dynamically modified to change the system performance.
Note: Before changing any value in any of these files, make sure you know everything about the
file to avoid irreparable damage to the system.
Files in the /proc/sys/kernel/ directory
Note: The services are most commonly the scripts present in the /etc/rc.d/init.d/* directory and
are started by the init when the system is booted. So, to restart the service you can also do the
following:
/etc/rc.d/init.d/<script-for-the-service> start | stop | status
start, stop, and status are the values that these scripts take as input to perform the action.
User programs
A user or system program reads its configuration file every time it is launched. Remember, though,
that some system programs are spawned when the computer is turned on, and their behaviour
depends on what they read in the configuration files in /etc/. So, the first time a user program is
started, the default configuration is read from the files present in the /etc/ directory. Later, the user
can customise the programs by using rc and . (dot) files as explained in the next section.
For example, in my system I have installed the very useful wget utility. In /etc/ there is an /etc/
wgetrc file. In my home directory, there is a file named .wgetrc, which describes my customised
configuration (which will be loaded only when I, the user run the wget command). Other users may
also have the .wgetrc file in their home directory (/home/other); this file will be read, of course,
only when the user runs the wget command. In other words, the /etc/wgetrc file provides "default"
values for wget, while the /home/xxx/.wgetrc file lists the "customisations" for a certain user. It is
important to understand that this is the "general rule," and is not necessarily true for all cases. A
program like pine, for instance, does not have any files in /etc/, but only the custom configuration
in the users' home directory, in a file named .pinerc. Other programs may only have a default
configuration file in /etc/, and may not let users "customize" them (it's the case with only a few of
the config. files in the /etc dir.).
~/.fvwmrc ~/.fvwm2rc Config files for fvwm and fvwm2 (the basic X
Window manager).