Kahibaro
Discord Login Register

`/etc`

Purpose of `/etc`

/etc is the central place for system-wide configuration files on a Linux system. Anything that controls how the system and services behave (for all users) is very likely to live here.

Key points:

You usually need sudo (or root) to edit files in /etc.

General Conventions in `/etc`

You’ll see a few common patterns:

When unsure what a file does, use man (e.g. man fstab, man sshd_config) if available.

Key Areas Inside `/etc`

This is not a complete list, but covers the most commonly encountered parts for beginners.

System Identity and Network Basics

    127.0.0.1   localhost
    127.0.1.1   my-laptop

User and Authentication Configuration

These files do not usually store plain-text passwords anymore, but they define user accounts and related policies:

System-Wide Shell and Environment Settings

Per-user shell configuration typically lives in files like ~/.bashrc, ~/.profile, etc., which supplement or override these global settings.

Service and Daemon Configuration

Most system services keep their configuration under /etc, usually in subdirectories:

When installing new packages, you’ll often see new config files appear in /etc/ or /etc/<package-name>/.

Package Manager Configuration (Distribution-Specific)

Each distribution’s package manager keeps its configuration in /etc:

Editing these files controls where software comes from and how the package manager behaves.

Boot and Filesystem Configuration

Some bootloader-related configs (e.g. GRUB) also live under /etc:

Application and Desktop Configuration (System-Wide)

System-wide defaults for various tools often live under /etc:

Many graphical or desktop-related defaults may also be placed here by packages.

Working Safely with `/etc`

Because /etc controls system behavior, changes can easily break things. A few safe practices:

  sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
  sudo sshd -t

to validate /etc/ssh/sshd_config.

  sudo systemctl restart ssh

What Belongs in `/etc` (and What Does Not)

As a rule: if you’re changing how the system as a whole behaves, you’re probably editing something in /etc.

Views: 19

Comments

Please login to add a comment.

Don't have an account? Register now!