File permissions · modechmod 777 — rwxrwxrwx
What chmod 777 (rwxrwxrwx) means, who is allowed to do what, and when these permissions are used: do not use: full access for absolutely everyone.
Open in the calculator01
What breaks
02
Easily confused with
755rwxr-xr-x
what is almost always needed instead: the owner edits, everyone else reads and enters.
chmod 755 →1777rwxrwxrwt
if shared writing really is needed: the sticky bit forbids deleting other people's files, as in /tmp.
chmod 1777 →03
Commands for this case
chown -R www-data:www-data /var/www/site
this is almost always what was needed instead of 777
find . -type d -exec chmod 755 {} + && find . -type f -exec chmod 644 {} +
restore sane permissions after a 777
Work out other permissions
The calculator opens on this mode: checkboxes, octal and symbolic notation, an ls -l line and the ready command.
Updated