Symbolic: -rwxrwxrwx · World read, write & execute · Critical production security risk
chmod 777 (0777)CRITICAL RISKSSH 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.
DO 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)
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.
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.