The Filesystem & Access Control

Deconstructing inodes, the Filesystem Hierarchy Standard (FHS), and resolving permission faults.

v1.0.0 Updated: September 02, 2026

The Filesystem Hierarchy Standard (FHS)

Unlike Windows, which assigns individual drive letters (C:, D:), Linux unifies all physical storage devices into a single, contiguous directory tree starting at the root (/). The Filesystem Hierarchy Standard (FHS) dictates exactly where specific types of data must reside:

  • /bin and /usr/bin: Essential user binaries (executables like ls, cat).
  • /etc: Host-specific system configuration files (no binary executables belong here).
  • /var: Variable data that changes during system operation (logs, databases, spool files).
  • /home: User-specific data and personal configuration files.
  • /dev: Device files representing attached physical and pseudo-hardware.

Inodes vs. File Names

The most fundamental concept in Linux storage is that a file name and the file data are two completely separate entities.

When you save data to a disk, the filesystem creates an inode (Index Node). The inode is a metadata structure containing the file’s permissions, ownership, timestamps, and pointers to the actual physical data blocks on the disk. The inode does not contain the file name.

A “directory” in Linux is simply a special type of file that contains a mapped list of file names to their corresponding inode numbers (called directory entries or “dentries”).

graph LR subgraph Directory Entry Name[File Name: 'config.yaml'] end subgraph Inode Table INode[Inode: 104857] Meta[Permissions: 644
Owner: root
Size: 2KB] end subgraph Disk Blocks Data[(Physical Data Blocks)] end Name -->|Points to| INode INode --- Meta INode -->|Points to| Data

This architecture explains why a single file can have multiple names (Hard Links)—they are simply multiple directory entries pointing to the exact same inode.

Access Control: User, Group, Others (UGO)

Linux permissions are evaluated using a strict triad of identity: User (the owner), Group (the assigned user group), and Others (everyone else).

Each of these identities is assigned three specific permissions: Read (r), Write (w), and Execute (x). When viewing a file with ls -l, this is represented as a 10-character string (e.g., -rwxr-xr--).

These permissions translate to an octal numeric system, which is standard in configuration management and automation:

  • Read (r) = 4
  • Write (w) = 2
  • Execute (x) = 1

A permission of 755 (common for web directories) breaks down as:

  • User (7): 4 (read) + 2 (write) + 1 (execute) = Can do everything.
  • Group (5): 4 (read) + 1 (execute) = Can read and enter the directory.
  • Others (4): 4 (read) = Can only read files.
🛑
Security Anti-Pattern: Executing chmod 777 grants universal read, write, and execute permissions to every process on the system. It is a catastrophic security failure and should never be used to bypass a “Permission Denied” error. You must identify the correct user or group and assign precise ownership using chown or chmod.

Directory Execute Permissions

A common source of confusion is the “Execute” (x) bit on a directory. You cannot “execute” a folder like a script. Instead, on a directory, the x bit grants traversal rights. It gives the user permission to enter the directory (via cd) and access the inodes inside it, provided they know the file names.

Test Your Understanding

Q:You are logged in as a standard user. You attempt to delete a log file owned by the `root` user, expecting a permission denied error. Instead, the file is successfully deleted. How is this possible? Reveal ▾
Deleting a file does not actually require write permissions on the file itself; it requires write permissions on the directory containing the file. Deleting a file simply removes the entry from the directory’s list. If your user has write permissions (w) on the parent directory, you can delete any file inside it, regardless of who owns the file or what the file’s specific permissions are.

Further Exploration

← Previous
Linux Architecture & The Systems View