Use it to find or change a service's configuration, or to back up a system's configuration.
/etc
/etc holds system-wide configuration files: services, users (passwd, shadow), networking, fstab, cron and more.
1. ls -ld /etc and findmnt /etc — present and mounted where expected?
2. df -h /etc — space left? df -i /etc — inodes left?
3. Find large or unexpected content: du -xh --max-depth=1 /etc | sort -h | tail.
4. Permissions and owner as the FHS and services expect?
5. Fix space, permissions or mount, then retest the service.
/etc mounted (or virtual) → correct owner and permissions → enough space → services read and write as intended
For Filesystem → /etc, continue with the first unproven Topic check: Identify exact config path, ownership source and include/drop-in precedence. If that boundary is healthy, advance to the adjacent check: Validate syntax/semantics with the owning application before activation where possible. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
authoritative /etc source → include/drop-in precedence → parser/validation → process load/reload → effective runtime configuration → service behavior → workload verification
Healthy evidence: authoritative files, precedence and ownership are known, validation passes, the intended process has loaded the expected values and the original workload succeeds.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Identify exact config path, ownership source and include/drop-in precedence.
- Validate syntax/semantics with the responsible application before activation where possible.
- Compare file content with the running service effective state and reload/restart requirement.
- Verify the original service/workload behavior and security posture after activation.
Verification chain. authoritative /etc source → include/drop-in precedence → parser/validation → process load/reload → effective runtime configuration → service behavior → workload verification
Step 3 Commands Verify boundary
ls /etc
etckeeper vcs log | head # if etckeeper is used
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: a file edit is declared effective without reload/read-back, stale drop-ins override the visible file, or secret-bearing files are made broadly readable to fix access.
/etc content shows persistent configuration source state, not that a process loaded it, that permissions are safe or that the resulting service works.
Step 5 Common mistakes Narrow the fault
- Editing config without backups or version control.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Back up a file before editing; many services validate their config (sshd -t, nginx -t). Package updates may leave new defaults as .dpkg-dist or .rpmnew files next to your edited one — compare them.
ls -ld <path>— owner, permissions and typestat <path>— inode, links, size and timestampsdf -h <path>— filesystem and free spacefindmnt <path>— which mount the path is on
ReferenceWhat it is1 section · depth on demand
Core model
Identify the authoritative configuration file(s), include/drop-in precedence and package/local ownership, then show which configuration the running process actually loaded. Validate syntax and effective runtime state separately. A correct file on disk is only requested configuration until the consumer reloads/restarts or otherwise observes it.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
/etc content shows persistent configuration source state, not that a process loaded it, that permissions are safe or that the resulting service works.
In depth
/etc: host configuration
The hier(7) manual page describes /etc as holding configuration files local to the machine. It's the most important directory to back up and to keep under change control. Files are normally plain text, and many programs read a main file plus a .d drop-in directory.
Important files and directories
| Path | Configures |
|---|---|
/etc/fstab | File systems mounted at boot |
/etc/hostname, /etc/hosts | Host name; static name resolution |
/etc/resolv.conf | DNS resolver (often managed by systemd-resolved) |
/etc/passwd, /etc/group, /etc/shadow | Local accounts |
/etc/sudoers, /etc/sudoers.d/ | sudo rules |
/etc/ssh/ | SSH server and client |
/etc/systemd/system/ | Local unit files and drop-ins |
/etc/sysctl.d/ | Kernel parameters |
/etc/default/ | Defaults for programs and init scripts (Debian family) |
/etc/sysconfig/ | The same role on the RHEL family |
/etc/os-release | Distribution name and version |
Drop-in directories
| Main file | Drop-in directory |
|---|---|
/etc/sysctl.conf | /etc/sysctl.d/*.conf |
/etc/ssh/sshd_config | /etc/ssh/sshd_config.d/*.conf |
/etc/sudoers | /etc/sudoers.d/ |
/etc/apt/sources.list | /etc/apt/sources.list.d/ |
Putting local changes into drop-in files keeps them separate from package defaults. Package upgrades can then update the main file without overwriting or conflicting with them.
Package-managed configuration
When a package update ships a new version of a file you've changed, Debian asks or keeps both, as .dpkg-dist or .dpkg-old. RPM writes .rpmnew or .rpmsave. Search for these after upgrades, and merge the changes.
host$ cat /etc/os-release | grep -E "^(NAME|VERSION_ID)="
NAME="Ubuntu"
VERSION_ID="24.04"
host$ sudo find /etc -name '*.dpkg-dist' -o -name '*.dpkg-old' -o -name '*.rpmnew' -o -name '*.rpmsave'
/etc/ssh/sshd_config.dpkg-dist
host$ diff -u /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-dist | head
host$ sudo debsums -ce
/etc/ssh/sshd_config
host$ sudo etckeeper init && sudo etckeeper commit "baseline"
host$ sudo git -C /etc log --oneline -3
Version control for /etc
etckeeper keeps /etc in a Git repository, and commits automatically before and after package operations. That gives a history of every configuration change on the host. debsums -ce lists configuration files that differ from what the package shipped.
Documented example, not captured output.
How it works at runtime
/etc is part of Filesystem → /etc. /etc contains host-specific system and service configuration plus related policy files; it is primarily persistent configuration, while generated runtime state should normally live elsewhere such as /run or /var.
Topic-specific state model. /etc contains host-specific system and service configuration plus related policy files; it is primarily persistent configuration, while generated runtime state should normally live elsewhere such as /run or /var.
Interpretation rule. - Configuration edited in /etc ≠ running process has loaded the change.
- One file ≠ complete effective configuration when includes, drop-ins or generated fragments apply.
- Package default file ≠ locally authoritative value after overrides.
- Readable configuration ≠ safe permissions for secrets or private keys stored beneath /etc.
Quick reference
/etc holds host configuration as text files. Patterns worth knowing:
*.d/drop-in directories (/etc/sudoers.d,/etc/sysctl.d,/etc/ssh/sshd_config.d) let packages and automation add config without editing the main file.- Distribution defaults may live in
/usr/lib(/usr/lib/systemd/system,/usr/lib/sysctl.d) and are overridden by/etc. - Package managers keep your edits:
.rpmnew/.rpmsave,.dpkg-dist/.dpkg-oldfiles appear on conflicts.
find /etc -name '*.rpmnew' -o -name '*.dpkg-dist'
etckeeper init; etckeeper commit 'baseline'
rpm -Vf /etc/ssh/sshd_config # changed from package default?
Limits and how it fails
Primary failure point. /etc content shows persistent configuration source state, not that a process loaded it, that permissions are safe or that the resulting service works.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. /etc owns Linux configuration-placement semantics. Individual service syntax, secrets, permissions and systemd activation belong to their dedicated branches.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Filesystem → /etc. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
/etc operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for /etc.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | /etc contains host-specific system and service configuration plus related policy files; it is primarily persistent configuration, while generated runtime state should normally live elsewhere such as /run or /var. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin process/container mount namespace → resolve the exact path from / and record every mount crossing → identify final dentry + filesystem/device + inode + file type → capture ownership/mode/ACL and capacity where relevant → map pseudo/device/runtime objects to the live kernel/process endpoint → verify the original consumer read/write/execute/service result. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | authoritative /etc source → include/drop-in precedence → parser/validation → process load/reload → effective runtime configuration → service behavior → workload verification | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | /etc content proves persistent configuration source state, not that a process loaded it, that permissions are safe or that the resulting service works. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated namespace, path and object evidence can establish this Linux Filesystem proof path: authoritative /etc source → include/drop-in precedence → parser/validation → process load/reload → effective runtime configuration → service behavior → workload verification | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured namespace, mount, inode/object, authorization, backing-resource or consumer scope. /etc content proves persistent configuration source state, not that a process loaded it, that permissions are safe or that the resulting service works. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: preserve the same process mount namespace, resolve the path and mount crossings, identify the exact object/inode or live pseudo/device endpoint, inspect effective access/capacity, then repeat the original consumer operation before changing unrelated filesystem state. | Continue to the next unresolved boundary while preserving the original test condition. |
/etc · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | /etc |
|---|---|
| Topic path | Filesystem → /etc |
| Runtime state | /etc contains host-specific system and service configuration plus related policy files; it is primarily persistent configuration, while generated runtime state should normally live elsewhere such as /run or /var. |
| Fast checks | - Identify exact config path, ownership source and include/drop-in precedence. - Validate syntax/semantics with the owning application before activation where possible. - Compare file content with the running service effective state and reload/restart requirement. - Verify the original service/workload behavior and security posture after activation. |
| Verification chain | authoritative /etc source → include/drop-in precedence → parser/validation → process load/reload → effective runtime configuration → service behavior → workload verification Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | /etc content proves persistent configuration source state, not that a process loaded it, that permissions are safe or that the resulting service works. Boundary chain: process credentials/namespace → path/mount lookup → DAC/ACL/LSM → filesystem metadata → block/device/backend → completion/read-back. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |