chmod 755: The Standard Mode for Directories and Programs
755 is rwxr-xr-x: the owner can read, write and execute, and everybody else can read and execute but not modify. It is the default for directories and for programs, and it is the mode most people mean when they say normal permissions.
At a glance
- Octal
- 755, written 0755 in four digit form
- Symbolic
- u=rwx,g=rx,o=rx
- On a file
- -rwxr-xr-x
- On a directory
- drwxr-xr-x
- Owner
- Read, write, execute
- Group
- Read and execute, no write
- Others
- Read and execute. On a directory: list contents and enter it
In detail
On a directory, 755 is what a public path needs. The execute bit lets any process traverse into the directory to reach something inside, and the read bit lets it list the names. A web server serving files from /var/www needs execute on every directory in the path, not just the last one, which is why a single 750 directory halfway up a tree produces a 403 that looks like it comes from the wrong place.
On a file, 755 means the file is a program. Scripts, compiled binaries and CGI handlers want it. An HTML page, a stylesheet, a JSON config or a PNG does not, and marking those executable is harmless at runtime but noisy: it shows up in every listing, in every diff of file modes, and in security scans that look for unexpected executables.
The default umask of 022 produces 755 for directories and 644 for files, which is why these two modes account for the overwhelming majority of what you see on a typical system. If you are wondering what mode something should be and there is no specific reason to deviate, these are the two answers.
755 is a genuine security decision, not a neutral default. It means every local account can read the contents. That is right for a program and for public assets, and wrong for anything containing a credential, an API token or personal data, where 640 or 600 is the correct choice depending on whether a service group needs to read it.
The calculator lists 0755 as its first preset, and the fastest way to understand a mode you have inherited is to load it there and read the ls -l rendering. -rwxr-xr-x and drwxr-xr-x are the same nine bits meaning different things, and seeing both at once is what makes the file against directory distinction click.
Examples
chmod 755 /usr/local/bin/deploy
chmod u=rwx,g=rx,o=rx /usr/local/bin/deployfind /var/www/site -type d -exec chmod 755 {} +
find /var/www/site -type f -exec chmod 644 {} +
# or, using capital X, which sets execute only on
# directories and on files that already had it
chmod -R a=rX,u+w /var/www/siteThings that catch people out
- Every directory in the path needs the execute bit, not just the final one. A 700 home directory blocks a web server from reaching a 755 directory inside it, and the error surfaces as a forbidden response with no obvious cause.
- 755 on a data file is not a security hole but it is a smell. It usually means someone ran a recursive chmod without separating files from directories.
- 755 lets every local account read the file. On a shared or multi-tenant host that includes accounts you did not create, so it is the wrong mode for anything with a secret in it.
- Uploading files over SFTP or from a Windows machine often produces 755 or 777 on everything because the remote umask does not apply. Set the mode explicitly after transfer rather than trusting the default.
Try it: Chmod Calculator
Tick the nine permission boxes, or type an octal or symbolic value, and get the three digit and four digit octal, the ls -l rendering and the exact chmod command back.
Chmod Calculator
LOCAL · Browser-OnlyCalculate Unix file permissions with an interactive chmod builder
Permission Matrix
| Entity | Read (4) | Write (2) | Execute (1) | Octal | Symbolic |
|---|---|---|---|---|---|
| Owner (u) | 7 | rwx | |||
| Group (g) | 5 | r-x | |||
| Others (o) | 5 | r-x |
Special Bits
Advanced permission flags for executables and directories
Generated Permissions
755rwxr-xr-x-rwxr-xr-xchmod 755 filenamechmod u=rwx,g=rx,o=rx filenamePermission Breakdown
Owner (u)
7rwx- - Read files / list directory contents
- - Write / modify / delete
- - Execute / traverse directory
Group (g)
5r-x- - Read files / list directory contents
- - Execute / traverse directory
Others (o)
5r-x- - Read files / list directory contents
- - Execute / traverse directory
Common Permissions Reference
| Octal | Symbolic | Meaning |
|---|---|---|
777 | rwxrwxrwx | Full access for everyone |
755 | rwxr-xr-x | Owner full, others read and execute |
750 | rwxr-x--- | Owner full, group read and execute |
700 | rwx------ | Owner full access only |
666 | rw-rw-rw- | Read and write for everyone |
644 | rw-r--r-- | Owner read/write, others read only |
600 | rw------- | Owner read/write only |
555 | r-xr-xr-x | Read and execute for everyone |
444 | r--r--r-- | Read only for everyone |
400 | r-------- | Owner read only |
Related File permissions
All file permissions →chmod 644: The Default File Mode and When to Change It
644 gives the owner read and write and everyone else read only. Why it is the default for files under a 022 umask, and the cases where it is wrong.
chmod 750: Owner Writes, Group Reads, Others Shut Out
750 gives the owner everything, the group read and traverse, and everyone else nothing. The right mode for application directories that must stay private.
chmod 775: Owner and Group Write, Everyone Else Reads
775 gives the owner and group full access and leaves others with read and execute. The correct mode for shared directories, and why it needs setgid.
The Execute Bit on a Directory Means Traverse, Not Run
On a directory, execute grants the right to resolve names through it and read grants the right to list them. Why a directory at 644 cannot be entered.
chmod 711: Directories You Can Enter but Cannot List
711 gives others execute without read, so they can enter a directory by exact name but cannot list it. Where this is used and what it does not protect.
chmod 733: Blind Drop Directories and What They Miss
733 lets others write and traverse a directory without listing it. The upload drop box pattern, and why it needs the sticky bit to be safe.
Tools for this
- Chmod Calculator Free online chmod calculator - calculate Unix file permissions with an interactive chmod builder
- htaccess Generator Free online htaccess generator - generate Apache .htaccess redirect and rewrite rules