π« 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:
- User (u): The owner of the file.
- Group (g): Members of the file's assigned group.
- 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 orcdinto 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
755to getrwxr-xr-x, or vice versa. - π 1-Click Copy: Get the full bash command
chmod 755 filenameready 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)