Common configuration files

1.9 Identify common features and tools of the Linux client/desktop operating system.

📘CompTIA A+ Core 2 (220-1202)


Linux stores a lot of system information in text files, mainly in the /etc directory. These files are critical for the operating system and administrators to manage users, network settings, file systems, and more. Here are the key files you need to know:


1. /etc/passwd

Purpose: Stores basic information about users on the system.

Key Points:

  • Each line represents one user account.
  • Fields in each line (separated by colons :) usually include:
    1. Username – the login name.
    2. Password placeholder – an x if the password is stored elsewhere (usually /etc/shadow).
    3. User ID (UID) – unique number for the user.
    4. Group ID (GID) – primary group number.
    5. GECOS / Full name – optional info like full name, contact.
    6. Home directory – path to the user’s home folder.
    7. Shell – default command shell, e.g., /bin/bash.

IT Example:
When an admin creates a new user account on a Linux server, the system adds an entry in /etc/passwd. Other services, like FTP or SSH, read this file to verify usernames.


2. /etc/shadow

Purpose: Stores encrypted passwords and password-related settings.

Key Points:

  • Only accessible by root (administrator) for security.
  • Fields include:
    1. Username
    2. Encrypted password
    3. Last password change date
    4. Password expiration info (e.g., minimum/maximum days before change)

IT Example:
When a user logs in via SSH, the system checks /etc/shadow to verify the password. This separation from /etc/passwd ensures passwords are more secure.


3. /etc/hosts

Purpose: Maps hostnames to IP addresses locally.

Key Points:

  • Simple way to resolve names without using DNS.
  • Each line usually has an IP address followed by a hostname and optional aliases. 127.0.0.1 localhost 192.168.1.10 server1
  • Overrides or supplements DNS lookups.

IT Example:
A small office Linux workstation can use /etc/hosts to access internal servers without querying an external DNS server. This helps in testing or isolated networks.


4. /etc/fstab

Purpose: Defines how storage devices and partitions are mounted automatically at boot.

Key Points:

  • Each line defines a filesystem and options:
    1. Device or UUID – which disk/partition to mount.
    2. Mount point – where in the filesystem to attach it (e.g., /mnt/data).
    3. Filesystem type – e.g., ext4, xfs, ntfs.
    4. Mount options – read/write, user permissions, etc.
    5. Dump and fsck options – backup and file system check flags.

IT Example:
A Linux server with multiple hard drives will read /etc/fstab at boot to automatically mount storage volumes for databases or shared folders.


5. /etc/resolv.conf

Purpose: Specifies DNS servers for hostname resolution.

Key Points:

  • Contains entries like: nameserver 8.8.8.8 nameserver 8.8.4.4
  • Tells the system which DNS servers to query when translating domain names to IP addresses.

IT Example:
When a Linux client on a corporate network tries to access intranet.company.local, it queries the DNS servers listed in /etc/resolv.conf. If the file is misconfigured, the system won’t be able to resolve hostnames.


Summary Table for Quick Exam Recall

FilePurposeKey Use in IT
/etc/passwdStores user account infoSystem authentication & user management
/etc/shadowStores encrypted passwordsSecure password verification
/etc/hostsMaps hostnames to IPsLocal name resolution without DNS
/etc/fstabDefines mount points for disksAuto-mount drives and partitions at boot
/etc/resolv.confDefines DNS serversHostname resolution for network access

Exam Tip:

  • Remember that /etc/passwd is publicly readable, but /etc/shadow is restricted.
  • /etc/hosts and /etc/resolv.conf are both about name resolution, but /etc/hosts is local, while /etc/resolv.conf points to DNS servers.
  • /etc/fstab is all about file systems and mounting—think “disk setup for boot.”
Buy Me a Coffee