Fundamentals 7 min read

Understanding the Linux /etc Directory: Key Configuration Files Explained

This article walks through the most important files and subdirectories under /etc—such as /etc/profile, /etc/bashrc, user‑specific .bash_* files, /etc/motd, /etc/issue, shadow‑password utilities, fstab and rc.local—explaining when they are executed, what they configure, and how they affect system behavior.

Linux Tech Enthusiast
Linux Tech Enthusiast
Linux Tech Enthusiast
Understanding the Linux /etc Directory: Key Configuration Files Explained

/etc/profile

This file sets environment information for every user; it runs at the first login and can configure environment variables and aliases.

/etc/profile.d

A subdirectory of /etc/profile that stores additional environment configuration files, making classification and usage of new environments easier.

/etc/bashrc

Executed for each user running a bash shell; read when the shell starts and can also define aliases.

~/.bash_profile

User‑specific shell configuration executed once at login; it sets necessary environment variables and sources the user's .bashrc.

~/.bashrc

Per‑user bash configuration read at login and each time a new shell is opened.

~/.bash_logout

Executed each time a user logs out of the system or exits a bash shell.

/etc/motd

Stores the message‑of‑the‑day (welcome information). Edit with vi; changes take effect after reconnecting.

/etc/issue and /etc/issue.net

Both hold welcome text displayed before login. /etc/issue is shown on local console login (before the login prompt), while /etc/issue.net is used for remote telnet logins. The content is the same by default but can be edited separately. The ssh banner is controlled by the Banner field in /etc/ssh/sshd_config.

Escape characters in /etc/issue

\d – local date

\l – terminal line

\m – hardware architecture

\n – host name

\o – domain name

\r – OS version

pwconv and pwunconv

pwconv enables shadow passwords, moving password hashes from /etc/passwd and /etc/group to /etc/shadow and /etc/gshadow, restricting read access to root. pwunconv reverses this, moving hashes back to /etc/passwd and /etc/group, reducing security.

/etc/fstab

Controls automatic mounting at boot. Example commands:

# mount /dev/sr0 /mnt
# echo "/dev/sr0 /mnt iso9660 defaults 0 0" >> /etc/fstab

/etc/rc.local

Used for commands that should run automatically at system startup.

Linuxbashsystem configurationenvironment variablesstartup scripts/etcshadow passwords
Linux Tech Enthusiast
Written by

Linux Tech Enthusiast

Focused on sharing practical Linux technology content, covering Linux fundamentals, applications, tools, as well as databases, operating systems, network security, and other technical knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.