Skip to main content
Navigation
HomeTechnical ReferenceJournalGitHubGitHub
Sidebar — toggle document categories via the logo
Categories

Common Linux Configuration Locations

Overview

Linux systems store configuration in predictable locations. Knowing where to look reduces troubleshooting time and avoids guesswork during incident response. This reference catalogs the most commonly encountered configuration files and directories on Debian-based and RHEL-based distributions.

System configuration

PurposePathNotes
Hostname/etc/hostnameStatic hostname set at boot.
Hosts file/etc/hostsStatic host-to-IP mappings.
Network interfaces/etc/network/interfacesDebian-based; RHEL uses /etc/sysconfig/network-scripts/.
DNS resolver/etc/resolv.confOften generated by systemd-resolved or NetworkManager.
NSS configuration/etc/nsswitch.confControls name resolution sources (hosts, users, groups).
System-wide environment/etc/environmentHardcoded env vars; not a script.
Shell profiles/etc/profile, /etc/profile.d/Applied at login for all users.
bashrc (system)/etc/bash.bashrc (Debian), /etc/bashrc (RHEL)Applied for interactive non-login shells.
Issue messages/etc/issue, /etc/motdPre-login banner and Message of the Day.
Timezone/etc/localtime and /etc/timezoneSystem timezone definition.
Locale/etc/default/locale and /etc/locale.genLanguage and regional settings.

User and authentication

PurposePathNotes
Local users/etc/passwdUser account definitions.
Password hashes/etc/shadowEncrypted passwords and aging info.
Local groups/etc/groupGroup definitions.
Group passwords/etc/gshadowGroup passwords (rarely used).
Sudoers/etc/sudoers and /etc/sudoers.d/Edit only with visudo.
PAM configuration/etc/pam.d/Pluggable Authentication Modules configs.
Login defaults/etc/login.defsUID/GID ranges, password aging defaults.
Allowed shells/etc/shellsValid login shells for users.
Skeleton files/etc/skel/Copied to new user home directories.

Service configuration

PurposePathNotes
systemd units/etc/systemd/system/ and /usr/lib/systemd/system/Custom units belong in /etc/systemd/system/.
systemd config/etc/systemd/system.confGlobal systemd daemon settings.
journald config/etc/systemd/journald.confJournal storage and retention.
resolved config/etc/systemd/resolved.confDNS/LLMNR settings.
timesyncd config/etc/systemd/timesyncd.confNTP synchronization settings.
Cron jobs/etc/crontab, /etc/cron.d/, /etc/cron.daily/, etc.System-level scheduled tasks.

SSH configuration

PurposePathNotes
SSH server config/etc/ssh/sshd_configRequires sshd reload after changes.
SSH client config/etc/ssh/ssh_configSystem-wide client defaults.
Host keys/etc/ssh/ssh_host_*_key*Server identity keys.
Authorized keys~/.ssh/authorized_keysPer-user public key authentication.

Logging configuration

PurposePathNotes
rsyslog config/etc/rsyslog.conf and /etc/rsyslog.d/Syslog routing rules.
Log rotation/etc/logrotate.conf and /etc/logrotate.d/Per-service rotation rules.
Log files/var/log/All system and daemon logs.

Package management

PurposePath (Debian)Path (RHEL)Notes
Repository lists/etc/apt/sources.list, /etc/apt/sources.list.d//etc/yum.repos.d/Package sources.
Preferences/pinning/etc/apt/preferences, /etc/apt/preferences.d/N/APriority rules for packages.
APT configuration/etc/apt/apt.conf.d/N/AAPT options (proxy, caching, etc.).
GPG keys/etc/apt/trusted.gpg, /etc/apt/trusted.gpg.d//etc/pki/rpm-gpg/Repository signing keys.

Network services

PurposePathNotes
Nginx/etc/nginx/nginx.conf, /etc/nginx/sites-available/Web server config.
Apache/etc/apache2/apache2.conf, /etc/apache2/sites-available/Debian layout.
Apache/etc/httpd/conf/httpd.conf, /etc/httpd/conf.d/RHEL layout.
PostgreSQL/etc/postgresql/<version>/main/DB server config.
MySQL / MariaDB/etc/mysql/my.cnf, /etc/mysql/mariadb.conf.d/DB server config.
Redis/etc/redis/redis.confCache server config.
Docker/etc/docker/daemon.jsonDocker daemon settings.
containerd/etc/containerd/config.tomlContainer runtime config.

Kernel and boot

PurposePathNotes
Kernel parameters/etc/sysctl.conf, /etc/sysctl.d/Runtime kernel tunables.
Module loading/etc/modules (Debian), /etc/modules-load.d/Kernel modules to load at boot.
Module options/etc/modprobe.d/Module parameters and blacklisting.
GRUB config/etc/default/grubBootloader defaults.
GRUB scripts/etc/grub.d/Bootloader menu generation.
fstab/etc/fstabFilesystem mount definitions.

Application configuration conventions

  • /etc/<application>/ — System-wide configuration for daemons and services.
  • ~/.config/<application>/ — Per-user configuration on modern distributions (follows XDG Base Directory spec).
  • ~/.<application>/ or ~/.<application>rc — Legacy per-user dotfiles in the home directory.
  • ~/.local/share/<application>/ — User-specific data files.
  • ~/.cache/<application>/ — User-specific non-essential cache files.

Configuration commands

# Apply sysctl changes
sysctl -p /etc/sysctl.d/99-custom.conf
sysctl --system

# Rebuild initramfs (Debian)
update-initramfs -u

# Update GRUB after config changes
update-grub # Debian
grub2-mkconfig -o /boot/grub2/grub.cfg # RHEL

# Test SSH server config
sshd -t

# Test nginx config
nginx -t

# Test Apache config
apache2ctl configtest # Debian
httpd -t # RHEL

# Validate sudoers
visudo -c

Quick lookup

# Find configuration files for a service
find /etc -name "*nginx*"

# Locate binaries and man pages for a package
dpkg -L nginx # Debian: list all files in a package
rpm -ql nginx # RHEL: list all files in a package

# Find which package owns a config file
dpkg -S /etc/nginx/nginx.conf # Debian
rpm -qf /etc/nginx/nginx.conf # RHEL

See also