DEV Community

Nadim Chowdhury
Nadim Chowdhury

Posted on

Understanding Linux File Permissions: The Visual Chmod Octal & Symbolic Guide

🚫 Stop Running chmod 777 in Production!

We've all seen developers run chmod -R 777 /var/www when hitting a "Permission Denied" error.

While it temporarily fixes the problem, 777 gives read, write, and execute permissions to everyone on the system β€” opening your server to severe remote code execution and privilege escalation attacks.


🧠 The 3 User Classes & 3 Permission Types

In Unix/Linux filesystems, every file has permissions divided across 3 user classes:

  1. User (u): The owner of the file.
  2. Group (g): Members of the file's assigned group.
  3. Others (o): Everyone else.

Each class has 3 distinct permission bits:

  • Read (r = 4): Permission to read the file contents or list a directory.
  • Write (w = 2): Permission to edit/delete the file or create files in a directory.
  • Execute (x = 1): Permission to run the file as a binary/script or cd into a directory.

πŸ”’ Common Linux Permission Numbers Explained

Octal Value Symbolic String Common Use Case
644 rw-r--r-- Standard files (HTML, CSS, JSON, config files). Owner edits, others only read.
755 rwxr-xr-x Executable scripts & directories. Owner has full control; others can execute/list.
600 rw------- Private cryptographic keys (~/.ssh/id_rsa) and sensitive credentials. Owner only.
700 rwx------ Private user directories (~/.ssh/, root folders).
777 rwxrwxrwx ⚠️ DANGEROUS: Everyone can read, write, and execute. Avoid in production.

πŸ› οΈ The Interactive Visual Chmod Calculator

Instead of memorizing bitwise math, use the Omnikite Chmod Calculator:

  • πŸŽ›οΈ Clickable Grid: Toggle Read, Write, and Execute checkboxes for Owner, Group, and Others.
  • πŸ”„ Real-Time Bidirectional Sync: Enter 755 to get rwxr-xr-x, or vice versa.
  • πŸ“‹ 1-Click Copy: Get the full bash command chmod 755 filename ready to paste into your terminal.

πŸš€ Check Your Permissions Online

πŸ‘‰ Try the Free Chmod Calculator: https://omnikite.vercel.app/tools/developer/chmod-calculator

Top comments (0)