Skip to the content

chmod 755

The owner can do everything, everyone else can read and execute. The usual mode for directories, programs and scripts.

Read (4)Write (2)Execute (1)Digit
Owner7
Group5
Others5

A program runs with the rights of the file's owner.

A program runs with the file's group. In a directory, new files get the directory's group.

In a directory, users can't delete or rename each other's files.

Owner can read, write and execute. Group and others can read and execute.

chmod 755 file
chmod u=rwx,g=rx,o=rx file

Common values

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

What 755 allows

WhoDigitOn a fileOn a directory
Owner7 rwxread, change and runlist, enter, add and remove files
Group5 r-xread and runlist and enter
Others5 r-xread and runlist and enter

ls -l shows this mode as -rwxr-xr-x on a file and as drwxr-xr-x on a directory.

The owner can change the file. Everybody else can use it and can't change it.

Where it belongs

  • Directories. 755 is what mkdir gives a new directory under the common umask of 022. Everyone can look around in it, only the owner can add or remove files.
  • Programs and scripts. The commands in /usr/bin are typically 755: root can replace them, every user can run them.
  • The directories of a website, so that the web server can read them without owning them. The files inside are usually 644.

Where it doesn't

On an ordinary file, such as a text or an image, the execute bits serve no purpose, and a data file that can be run by accident is one more thing that can go wrong. Those want 644. To put a whole tree in order, treat directories and files separately:

find . -type d -exec chmod 755 {} +
find . -type f -exec chmod 644 {} +

chmod -R 755 . would make every file executable as well.

The chmod calculator explains how the digits are built, and what setuid, setgid and the sticky bit add to them.

See all 12