Course contentsShow
← Computer Science
Lesson 1392 of 2,87232. File SystemsFree lesson

File Permissions and Access Control

Understand permission models (read, write, execute), user/group/other permissions, and access control mechanisms.

File Permissions and Access Control

You'll learn how operating systems decide who can read, modify, or execute files.

When multiple users share a computer system, the OS must control access to files—otherwise anyone could delete, modify, or steal anyone else's data. File permissions form the basic security model that protects files from unauthorized access.

The Permission Model

Most Unix-like systems use three types of permissions:

  • Read (r): View file contents or list directory contents
  • Write (w): Modify file contents or create/delete files in a directory
  • Execute (x): Run a file as a program, or enter a directory

Permission Classes

Permissions apply to three categories of users:

  • Owner/User: The file's creator or designated owner
  • Group: A set of users who share access (e.g., a project team)
  • Other/World: Everyone else on the system

Think of it like a building: you (owner) have a master key, your team (group) has department keys, and visitors (other) might only access the lobby.

Access Control Mechanisms

When you try to open a file, the OS checks:

  1. Are you the owner? Use owner permissions.
  2. Are you in the file's group? Use group permissions.
  3. Otherwise, use "other" permissions.

Each check stops at the first match. For example, if you're the owner but have no read permission, you cannot read the file—even if "other" has read access.

Many systems also support Access Control Lists (ACLs), which allow fine-grained control beyond the simple user/group/other model, specifying permissions for individual users or groups.

Key Takeaway: File permissions use a three-tier model (read/write/execute) applied to three user classes (owner/group/other) to control who can access files, forming the foundation of multi-user system security.