What does chmod 755 mean? Directory permissions, script execution, and security
755 is the correct default for directories and executable scripts. It balances usability and security. If you're ever unsure what permissions to set, start at 755 for directories and 644 for files, then tighten from there.
chmod 755 sets permissions to rwxr-xr-x: the owner can read, write, and execute, while the group and everyone else can read and execute but not modify. This is a common baseline for directories and executable scripts on Unix-like systems, and for good reason: it lets the owner manage files while letting everyone else use them without write access.
By TechCompare · Updated
How this is calculated
In octal, 7 = 4+2+1 (read+write+execute) and 5 = 4+0+1 (read+execute). The three digits apply to owner, group, and others in that order. 755 is a common baseline because it prevents other users from modifying the file while still letting them read it or, for a directory, search and enter it. For web servers, 755 on directories and 644 on files is a common deployment baseline. Never use 777 unless you have a very specific reason and understand its world-write implications.
Verdict
The octal math breaks down to 7 (4+2+1, read+write+execute) for the owner and 5 (4+0+1, read+execute) for group and others, which is exactly what directories and executable scripts need: the owner manages, everyone else can navigate or run. The execute bit on directories isn't really 'execution', it's 'permission to enter and look up files inside', which is why stripped-down 644 directories leave users unable to even cd into them. On web-server document roots the canonical pairing is 755 for directories and 644 for the files inside, with the web-server user (www-data, nginx) landing in the 'others' bucket so it can read and serve without ever being able to write.
