chmod 777 Linux Permissions Calculator

Symbolic: -rwxrwxrwx · World read, write & execute · Critical production security risk

chmod 777 (0777) CRITICAL RISK SSH KEY REJECTED
4-digit: 0777
Dir: drwxrwxrwx
Presets:
Interactive Permission Matrix (3×3 + Special Bits) -rwxrwxrwx
Scope Read (4) Write (2) Execute (1) Digit Sum
Owner (u) 4(r) + 2(w) + 1(x) = 7
Group (g) 4(r) + 2(w) + 1(x) = 7
Others (o) 4(r) + 2(w) + 1(x) = 7
Special Mode Bits (4th Leading Octal Digit) 0 (none)
File / Dir Symbolic
-rwxrwxrwx / drwxrwxrwx
Binary Bitmask
111 111 111
umask Complement
Dir 000 · File 000
umask 000 creates dirs as 777 and files as 666 (files require explicit chmod +x).
Security Audit & Command Builder
World-Writable Without Sticky Bit (o+w): Mode 777 allows any local user or compromised daemon to modify, truncate, or replace this file/directory. Prefer 755 (dirs), 644 (files), or 775/664 with group ownership.
OpenSSH Audit (SSH KEY REJECTED): OpenSSH rejects private keys with 0777: "Permissions 0777 for 'id_ed25519' are too open. UNPROTECTED PRIVATE KEY FILE!" Run chmod 600 instead.
Apply Permission (Octal & Symbolic)
chmod 777 /var/www/uploads
Symbolic: chmod u=rwx,g=rwx,o=rwx /var/www/uploads
Recursive chmod -R
chmod -R 777 /var/www/uploads
Safe Recursive Split (Dirs vs Files via find)
find /var/www/uploads -type d -exec chmod 777 {} +
find /var/www/uploads -type f -exec chmod 666 {} +
Verify Permissions with stat
stat -c "%a %A %U:%G %n" /var/www/uploads
macOS/BSD: stat -f "%Op %Sp %Su:%Sg %N" /var/www/uploads
Side-by-Side Octal Comparison
Open /chmod/755/ →
Property chmod 777 (-rwxrwxrwx) chmod 755 (-rwxr-xr-x)
Octal (3/4-Digit)777 (0777)755 (0755)
File Symbolic-rwxrwxrwx-rwxr-xr-x
Directory Symbolicdrwxrwxrwxdrwxr-xr-x
Owner (u)Read, Write, Execute (7)Read, Write, Execute (7)
Group (g)Read, Write, Execute (7)Read, Execute (5)
Others (o)Read, Write, Execute (7)Read, Execute (5)
Special BitsNoneNone
Binary Bits111 111 111111 101 101
Matching umaskDir: 000 / File: 000Dir: 022 / File: 022
Security RiskCRITICAL RISKLOW RISK
SSH Private KeySSH KEY REJECTEDSSH KEY REJECTED
Common Use CaseDO NOT use in production. Only symbolic links naturally display lrwxrwxrwx (because symlink permissions are ignored; target permissions govern access). Use 755, 775, 644, or 1777 instead.Standard web directories & executable binaries/scripts (/var/www/html, /usr/local/bin)
chmod 777 · -rwxrwxrwx umask 000 (dir) / 000 (file)
Ctrl+Enter: Copy chmod · 100% Browser-Local
Advertisement
Reserved fixed-height slot (CLS = 0.00) 728×90 320×100 300×50

Why chmod 777 Is Dangerous and How to Safely Undo chmod -R 777

chmod 777 (-rwxrwxrwx) grants unrestricted read, write, and execute access to every local account, container process, and compromised daemon on the host. On a web server, a single directory traversal or upload bug turns a 777 folder into instant remote code execution; on a shared Linux host, any unprivileged user can replace a 777 script with a reverse shell or delete another user's files inside a 777 directory (because directory write without the sticky bit allows unlinking any file inside it).

If someone accidentally ran chmod -R 777 on a web app, undo it immediately with two targeted commands: find /var/www/app -type d -exec chmod 755 {} + and find /var/www/app -type f -exec chmod 644 {} + (then grant 775 only to specific writable upload/cache folders with proper chown group ownership). Even Linux /tmp never uses plain 777—it uses 1777 with the sticky bit so users cannot delete each other's temporary files.

  • Symbolic Mode-rwxrwxrwx (file) · drwxrwxrwx (directory) · Octal 0777
  • Permission BitsOwner: rwx (7) · Group: rwx (7) · Others: rwx (7)
  • Security AuditCRITICAL — Any local user/process can modify, delete, or inject code
How do I undo chmod -R 777 on a website directory?

Reset directories to 755 and regular files to 644: find /var/www/site -type d -exec chmod 755 {} + && find /var/www/site -type f -exec chmod 644 {} +, then restore +x only on actual scripts.

Why do symbolic links show lrwxrwxrwx (777) in ls -l?

On Linux, permissions on the symlink inode itself are unused and always shown as 777 (lrwxrwxrwx); actual access control is enforced by the target file or directory permissions.

What should I use instead of chmod 777 for a shared temp or upload folder?

For app uploads, use chown deploy:www-data with chmod 775 or 770. For multi-user temp directories like /tmp, always add the sticky bit with chmod 1777.