Guide to linux configuration files

This guide will show where various linux configuration files are located, shows howto configure them.

In many cases are global config files, and local config files.
 * Global config files
 * Apply to all users
 * Usually located in /etc
 * Local config files
 * Applies to a specific user
 * Stored in the users home dir, as ~/.example or ~/.config/example
 * AKA dot files

Locations of config files change name and location over time and different Linux Distributions, so the files listed here may not match your Linux installation, but the are generally close.
 * For example
 * bashrc may be located in /etc/bash/bashrc or /etc/bashrc
 * kdmrc may be located in /usr/share/config/kdm/kdmrc, /usr/local/share/config/kdm/kdmrc, or /opt/kde/share/config/kdm/kdmrc

=/etc - the basics=


 * /etc/DIR_COLORS - colors use by the "ls" command
 * /etc/X11/ - config files for X-Windows
 * /etc/adjtime - correction factor for the RTC (do not edit)
 * /etc/bash/ - config files for bash
 * /etc/conf.d/ - config dir for Gentoo and other Distributions
 * /etc/cron.d/
 * /etc/cron.daily/ - scripts within are run daily by cron
 * /etc/cron.deny - list of users for which cron is denyed
 * /etc/cron.allow - list of users for which cron is allowed
 * /etc/cron.hourly/ - scripts within are run hourly by cron
 * /etc/cron.monthly/ - scripts within are run monthly by cron
 * /etc/cron.weekly/ - scripts within are run weekly by cron
 * /etc/crontab - general config for cron
 * /etc/cups/ - config dir for CUPS printer server
 * /etc/dbus-1/ - dir for dbus config files
 * /etc/default/ - dir for dbus config files like adduser
 * /etc/dhcpcd.conf
 * /etc/dispatch-conf.conf
 * /etc/e2fsck.conf - config for fschk for ext2 and ext3 filesystems
 * /etc/env.d/ - dir for environment variables in Gentoo and other distributions
 * /etc/environment - environment variables
 * /etc/exports - file systems are exported to remote hosts
 * /etc/filesystems - defines the filesystems search order used by mount -t auto
 * /etc/fonts/ - config dir for fontconfig
 * /etc/fstab - mount points
 * /etc/gconf/ - dir for Gnome based applications
 * /etc/gpm/ - console mouse
 * /etc/group - groups and the users within them
 * /etc/group- - (do not edit)
 * /etc/gshadow - Secure group account information
 * /etc/gshadow- - (do not edit)
 * /etc/host.conf - specifies how host names on a network are resolved
 * /etc/hosts - associates IP addresses with hostnames
 * /etc/init.d/ or /etc/rc.d/init.d/ - dir for init scripts
 * /etc/inittab - describes which processes are started at bootup
 * /etc/inputrc - keyboard mapping for bash and most other shells
 * /etc/issue - message displayed before console or ssh logins
 * /etc/kernel/ - dir for scripts such as post-installation of the Linux kernel
 * /etc/ld.so.cache - (do not edit)
 * /etc/ld.so.conf - library path
 * /etc/ld.so.conf.d/ - dir for config files that include library paths
 * /etc/local.d/ - scripts run by "local" init script
 * /etc/locale.gen - lists the locales used
 * /etc/localtime - symbolic link to a timezone file
 * /etc/login.defs - config for the shadow package
 * /etc/machine-id - unique machine id set during installation
 * /etc/mail/ - dir of config files for mail system
 * /etc/mailcap - describs how mime-types should be displayed
 * /etc/make.conf
 * /etc/man.conf - config for man
 * /etc/mime.types - (do not edit)
 * /etc/mke2fs.conf
 * /etc/modprobe.d/
 * /etc/mtab (do not edit)
 * /etc/netconfig
 * /etc/networks
 * /etc/nscd.conf
 * /etc/nsswitch.conf
 * /etc/pam.d/
 * /etc/papersize
 * /etc/passwd
 * /etc/passwd- (do not edit)
 * /etc/profile
 * /etc/profile.d/
 * /etc/profile.env
 * /etc/protocols - list of network protocols (do not edit)
 * /etc/rc.conf
 * /etc/resolv.conf
 * /etc/rpc - RPC program number database (do not edit)
 * /etc/runlevels/
 * /etc/securetty
 * /etc/security/
 * /etc/services
 * /etc/shadow - (do not edit)
 * /etc/shadow- - (do not edit)
 * /etc/shells
 * /etc/skel/
 * /etc/sound/
 * /etc/ssh/
 * /etc/ssl/
 * /etc/sudoers - config for sudo
 * /etc/sudoers.d/
 * /etc/sysctl.conf
 * /etc/sysstat
 * /etc/sysstat.ioconf
 * /etc/terminfo/
 * /etc/timezone
 * /etc/udev/
 * /etc/unixODBC/
 * /etc/updatedb.conf
 * /etc/xdg/
 * /etc/xinetd.d/

=Users and Groups=

Users: /etc/passwd
/etc/passwd is the user authentication database, it contains a list of users and their associated internal user id numbers. Historically it also included passwords, however as this file needs to world readable (so all programs can use it to convert between username and user id) it is no longer considered secure to keep passwords in this file.

An entry in this file is of the form:

alice:*:134:20:Alice Monkey:/home/alice/:/bin/bash

It has seven sections which going from left to right are,


 * (alice) The username.
 * (*) The password in a hashed form. In modern systems a star indicates shadowing is in use and hence the password can be found in /etc/shadow/.
 * (134) The unique id assigned to the user. Some unique ids have special purposes. For example, the user id 0 is used for the root user.
 * (20) The group that the user is assigned to upon login.
 * (Alice Monkey) The GCOS field can be used for anything or left blank. Normally used for personal information abou the user such as full name.
 * (/home/alice/) The home directory of the user.
 * (/bin/bash) The users default shell.

Groups: /etc/group
/etc/group stores the definitive list of the users groups and their members.

A typical entry is:

root::0:root,alice

It has four sections which going from left to right are,


 * (root) The group name.
 *  The group password in a hashed form. Normally not used.
 * (0) The unique id assigned to the group. Group ids below 10 are reserved for system use. Some unixs such as HP-UX reserve other groups numbers as well.
 * (root,alice) The list of users who are members of that group.

=Boot Up Settings=
 * Boot file sequence in the order they are accessed or executed
 * boot loader (grub/lilo)
 * linux kernel
 * /etc/inittab
 * /etc/rc.sysinit
 * init scripts
 * Login or X windows


 * /etc/inittab - runs different programs and processes on startup. This is typically the program which is responsible for, among other things, setting the default runlevel, running the rc.sysinit script contained in /etc/rc.d, setting up virtual login terminals, bringing down the system in an orderly fashion in response to [Ctrl][Alt][Del], running the rc script in /etc/rc.d, and running xdm for a graphical login prompt (only if the default runlevel is set for a graphical login).

See: Guide to linux boot sequence

LILO

 * /etc/lilo.conf - configuration file for lilo boot loader

Grub

 * Grub (legacy)
 * /boot/grub/grub.conf
 * Grub2
 * /boot/grub/grub.cfg - Menu information
 * /etc/default/grub - Basic configs
 * /etc/grub.d/ - scripts in this directory are read during execution of the update-grub command and their instructions are incorporated into /boot/grub/grub.cfg.

=Package Managers=
 * References:

portage
Optional:
 * /etc/make.conf
 * /etc/make.profile
 * /etc/portage/package.keywords
 * /etc/portage/package.use
 * /etc/portage/package.mask
 * /etc/portage/package.unmask
 * /etc/portage/package.accept_keywords
 * /etc/portage/rsync_excludes
 * /etc/portage/package.env
 * /etc/portage/env/debug-cflags
 * /etc/portage/postsync.d/
 * /etc/dispatch-conf.conf - dispatch-conf

References:

Paludis

 * /etc/paludis/general.conf
 * /etc/paludis/keywords.conf (Gentoo) or /etc/paludis/platforms.conf (Exherbo)
 * /etc/paludis/use.conf (Gentoo) or /etc/paludis/options.conf (Exherbo)
 * /etc/paludis/licenses.conf (Gentoo) or /etc/paludis/licences.conf (Exherbo)
 * /etc/paludis/bashrc
 * /etc/paludis/repositories/gentoo.conf (Gentoo)
 * /etc/paludis/repositories/installed.conf
 * /etc/paludis/repositories/paludis-overlay.conf
 * /etc/paludis/repositories/layman.conf
 * /etc/paludis/repositories/repository.conf
 * /etc/paludis/repositories/arbor.conf (Exherbo)
 * /etc/paludis/repositories/unavailable.conf (Exherbo)
 * Reference :

pacman
/etc/pacman.conf /etc/pacman.d/mirrorlist

apt

 * /etc/apt/apt.conf
 * /etc/apt/apt.conf.d/
 * Reference :
 * /etc/apt/sources.list
 * /etc/apt/sources.list.d/
 * Reference :
 * /etc/apt/vendors.list
 * Reference :
 * ~/.aptitude/config

yum

 * /etc/yum.conf
 * /etc/yum.repos.d/
 * /etc/yum/pluginconf.d/
 * /etc/yum/protected.d
 * /etc/yum/vars
 * Reference :
 * /etc/yum/yum-updatesd.conf
 * Reference :

rpm

 * /usr/lib/rpm/rpmrc
 * /usr/lib/rpm/redhat/rpmrc
 * /etc/rpmrc
 * ~/.rpmrc
 * /usr/lib/rpm/macros
 * /usr/lib/rpm/redhat/macros
 * /etc/rpm/macros
 * ~/.rpmmacros
 * Reference :


 * /etc/sysconfig/rhn/sources

dpkg

 * /etc/dpkg/dpkg.cfg
 * Reference :

opkg

 * /etc/opkg.conf
 * Reference :

Smart Package Manager
/etc/smart/ =Libraries=

=Environment Variables=
 * Library Path
 * /etc/ld.so.conf
 * after editing, execute &apos;/sbin/ldconfig&apos; to refresh the library cache
 * Generally environment variables are set in the shell start up scripts

=Networking=
 * Guide to environment variables
 * Howto set environment variables
 * /etc/hosts - contains a list of host names and absolute IP addresses.
 * /etc/hosts.allow - hosts allowed (by the tcpd daemon) to access Internet services
 * /etc/hosts.deny - hosts forbidden (by the tcpd daemon) to access Internet services
 * /etc/resolv.conf - contains a list of domain name servers used by the local machine
 * /etc/hostname - stores the name of the host computer

Howto setup a network in linux

=Servers= Config file for various Linux daemons. Included is Apache, Lighttpd, OpenSSHD, Samba, ProFTPd, MySQL, PostgreSQL, OpenNTPD, vsftpd, WU-FTPd, DNS BIND, NSD pdnsd

See: Guide to linux configuration files/Servers

=System=

Setting System/Hardware Clock

 * Symbolic link to timezone
 * /etc/localtime
 * UTC or local time zone


 * Howto Set the computers clock in unix
 * Howto set the computers timezone

Hard/USB/floppy/CDROM/Network Drive Mounts

 * /etc/fstab - Links devices to mount points


 * Howto edit fstab

Locale

 * /etc/locale.gen
 * ~/.dmrc - Gnome language encoding config
 * Reference:

locate/slocate/mlocate

 * /etc/updatedb.conf

sudo

 * /etc/sudoers

Kernel

 * /usr/src/linux/.config - the kernel&apos;s config file that is used to compile

Kernel Modules

 * /etc/modules.conf
 * /etc/modprobe.conf or /etc/modprobe.d/modprobe.conf

Cron

 * /etc/crontab - shell script to run different commands periodically (hourly, daily, weekly, monthly, etc.)
 * /etc/cron.deny - deny user the ability run crontab
 * /etc/cron.d/
 * /etc/cron.hourly/
 * /etc/cron.daily/
 * /etc/cron.weekly/
 * /etc/cron.monthly/

mdadm (RAID)

 * /etc/mdadm/mdadm.conf or /etc/mdadm.conf
 * References:

mkinitcpio (RAM disk init)
/etc/mkinitcpio.conf /etc/mkinitcpio.d/linux.preset
 * References:

syslog

 * syslogd
 * /etc/syslog.conf
 * References:
 * syslog-ng
 * /etc/syslog-ng/syslog-ng.conf
 * References:

ALSA

 * /etc/asound.conf
 * ~/.asoundrc
 * References:

DBUS

 * /etc/dbus-1/system.conf
 * /etc/dbus-1/system.d/
 * /etc/dbus-1/session.conf
 * /etc/dbus-1/session.d/
 * References:

udev

 * /etc/udev/* - udev config files
 * /etc/dev.d/* - programs invoked by udev
 * References:

logrotate

 * /etc/logrotate.conf
 * /etc/logrotate.d/
 * References:

AT

 * /etc/at.deny
 * /etc/at.allow
 * References:

PAM

 * /etc/pam.conf - the configuration file
 * /etc/pam.d - the Linux-PAM configuration directory. Generally, if this directory is present, the /etc/pam.conf file is ignored.
 * References:

=Applications=

See: Guide to linux configuration files/Applications

=Shells=


 * /etc/DIR_COLORS - used to store colors for different file types when using ls command. The dircolors command uses this file when there is not a .dir_colors file in the user&apos;s home directory. Used in conjunction with the eval command (see below).
 * /etc/motd - message of the day file, printed immediately after login. This is often overwritten by /etc/rc.d/rc.S (Slackware) or /etc/rc.d/rc.local (Mandrake/Red Hat) on startup. See the remarks in connection with /etc/issue.
 * /etc/issue - pre-login message. This is often overwitten by the /etc/rc.d/rc.S script (in Slackware) or by the /etc/rc.d/rc.local script (in Mandrake and Red Hat, and perhaps other rpm-based distributions). The relevant lines should be commented out (or changed) in these scripts if a custom pre-login message is desired.

bash

 * /etc/bashrc
 * /etc/profile
 * /etc/bashrc
 * /etc/bash/bashrc
 * /etc/bash/bash_profile
 * /etc/bash/bash_login
 * /etc/bash/bash_logout
 * ~/.profile


 * /etc/profile contains the system default settings for users who login using the Bourne shell, "/bin/sh". When these users login, the Bourne shell runs the commands in this file before giving the shell prompt to the user. Most of these commands are variable assignments which configure the behavior of the shell.
 * ~/.bash_logout - file executed by bash shell on logout
 * ~/.bash_profile - initialization of bash shell run only on login. Bash looks first for a .bash_profile file when started as a login shell or with the -login option. If it does not find .bash_profile, it looks for .bash_login. If it doesn&apos;t find that, it looks for .profile. System-wide functions and aliases go in /etc/bashrc and default environment variables go in /etc/profile.
 * ~/.bashrc - initialization command run when bash shell starts up as a non-login shell


 * /etc/inputrc


 * Examples: http://dotfiles.org/.bash_profile
 * Examples: http://dotfiles.org/.bashrc

csh

 * profile.csh
 * csh.login
 * csh.envc
 * sh.cshrc
 * /etc/cshrc
 * ~/.login
 * ~/.cshrc
 * ~/.logout

zshell (zsh)

 * Order they are loaded: /etc/zshenv then ~/.zshenv, if login shell /etc/zprofile then ~/.zprofile, if interactive shell /etc/zshrc then ~/.zshrc, If login shell, /etc/zlogin and ~/.zlogin
 * /etc/profile contains the system default settings for users who login using the Bourne shell, "/bin/sh". When these users login, the Bourne shell runs the commands in this file before giving the shell prompt to the user. Most of these commands are variable assignments which configure the behavior of the shell.


 * Examples: http://dotfiles.org/.zshrc
 * Examples: http://dotfiles.org/.zlogin

tcsh

 * ~/.login
 * ~/.tcshrc
 * ~/.logout

ksh

 * ~/.kshrc
 * /etc/profile
 * ~/.profile

sh

 * /etc/profile
 * ~/.profile

=X Windows=
 * 1) Starting X Windows
 * 2) /etc/X11/XF86Config for XFree86, /etc/X11/xorg.conf for X.Org
 * 3) many different scripts depending on install
 * 4) ~/.xinitrc
 * 5) * Executed whenb running startx, should contain your window managers executable
 * 6) ~/.Xdefaults


 * Howto configure XF86config

Look and Feel (User Interface)
Not all Windows managers follow these config files but many do.


 * Default application for a mimetype (XGD spec)
 * /usr/share/applications/defaults.list
 * ~/.local/share/applications/mimeapps.list
 * Application launcher, for menus and default apps
 * /usr/share/applications/*.desktop
 * ~/.local/share/applications/*.desktop
 * GTK based applications
 * /etc/gtk-2.0/gtkrc
 * ~/.gtkrc-2.0
 * ~/.gtkrc-2.0.mine - used when .gtkrc-2.0 is auto-generated, sourced from .gtkrc-2.0
 * ~/.config/gtk-2.0/gtkfilechooser.ini - options for file open/save chooser
 * /etc/gtk-3.0/settings.ini


 * Examples: http://dotfiles.org/.gtkrc-2.0

XDM
X-Windows default Display Manager
 * /etc/X11/xdm
 * /usr/X11R6/lib/X11/xdm - SuSE 6.4
 * /etc/X11/Xaccess - Client authorization ruleset.
 * /etc/X11/Xresources - Default X resource values.
 * /etc/X11/Xservers - List of remote and local displays to manage.
 * /etc/X11/Xsession - Default session script for logins.
 * /etc/X11/Xsetup_* - Script to launch applications before the login interface.
 * /etc/X11/xdm-config - Global configuration for all displays running on this machine.
 * /etc/X11/xdm-errors - Errors generated by the server program.
 * /etc/X11/xdm-pid - The process ID of the currently running XDM.


 * Depeding on your distribution /etc may be replaced by /usr/lib or /usr/local/lib

GDM
Gnome Display Manager
 * /etc/gdm/gdm.conf

KDM
KDE Display Manager
 * /usr/share/config/kdm/kdmrc

SLiM
/etc/slim.conf

Window Managers
Here are a very long list of config for many Window managers. Included are AfterStep, Awsome, Catwm, Enlightenment, Fluxbox, Fvwm95, Gnome, Herbstluftwm, IceWM, Ion, JWM, KDE, Matchbox, Mosterwm, Motif Window Manager, Musca, OpenBox, OpenLook Virtual Window Manager, OpenLook Window Manager, PMWM, Pawm, PekWM, QVWM, Sawfish, Snapwm, Tab Virtual Window Manager, Tab Window Manager (TWM), WMFS, Window Maker, XFCE, Xmonad, echinus, evilwm, fvwm2, fvwm, i3, ratpoison, spectrwm, subtle, wmii, and more

See: Guide to linux configuration files/Window Managers =Distribution Specific=

Redhat

 * Main Config files dir
 * /etc/sysconfig/


 * Redhat 8-9
 * Login Manager, add window manager
 * /etc/X11/xdm/Xsession
 * /usr/share/apps/switchdesk/Xclients.wmaker
 * /etc/X11/gdm/Sessions/wmaker

Suse

 * Main Config files dir
 * /etc/sysconfig/

Fedora

 * Main Config files dir
 * /etc/sysconfig/
 * References: Fedora 12 - Chapter 17. The sysconfig Directory

Gentoo

 * Main Config files dir
 * /etc/conf.d/
 * /etc/env.d/
 * Portage
 * /etc/portage/package.keywords
 * /etc/portage/package.unmask
 * /etc/portage/profile/package.provided
 * Compileing
 * /etc/make.conf
 * /etc/make.profile/make.defaults
 * /etc/make.profile/packages
 * /etc/make.profile/parent
 * /etc/profile.env
 * /etc/env.d/*
 * /etc/env.d/10ldpath
 * /etc/env.d/05gcc
 * /etc/env.d/01hostname
 * /etc/env.d/00basic
 * /etc/conf.d/*
 * /etc/conf.d/local.stop
 * /etc/conf.d/local.start

=Files to be merged in to the list= /etc/sysctl.conf configures the behavior of the running Unix kernel. During system boot, the scripts read this file and use "sysctl" to set the parameters shown in the file. Changing the file has no effect before the next reboot.
 * /etc/aliases - file containing aliases used by sendmail and other MTAs (mail transport agents). After updating this file, it is necessary to run the newaliases utility for the changes to be passed to sendmail.
 * /etc/conf.modules - aliases and options for configurable modules
 * /etc/exports - specifies hosts to which file systems can be exported using NFS. Man exports contains information on how to set up this file for remote users.
 * /etc/inetd.conf - configures the inetd daemon to tell it what TCP/IP services to provide (which daemons to load at boot time). A good start to securing a Linux box is to turn off these services unless they are necessary.
 * ~/.login - initialization file when user logs in
 * ~/.logout - commands run when user logs out
 * ~/.wm_style - gives choice of default window manager if one is not specified in startx
 * ~/.xsession - configuration file for xdm
 * ~/.htaccess

=Related guides=
 * Guide to Linux status and log files

=References=
 * http://www.comptechdoc.org/os/linux/commands/linux_crspfiles.html
 * http://www.sabayonlinux.org/forum/viewtopic.php?f=54&amp;t=10863
 * http://www.ibm.com/developerworks/linux/library/l-config/index.html
 * http://news.softpedia.com/news/Linux-configuration-files-and-what-they-do-34292.shtml
 * http://www.comptechdoc.org/os/linux/commands/linux_crspfiles.html
 * http://www.science.uva.nl/ict/guides/login/index_en.html
 * https://wiki.archlinux.org/index.php/Window_Manager#Window_managers
 * http://etutorials.org/Linux+systems/red+hat+linux+bible+fedora+enterprise+edition/Part+III+Administering+Red+Hat+Linux/Chapter+10+Understanding+System+Administration/Learning+about+Administrative+GUI+Tools+Commands+Configuration+Files+and+Log+Files/