Skip to the content

chmod 644

The owner can read and write, everyone else can only read. The usual mode for ordinary files such as documents, images and web pages.

Read (4)Write (2)Execute (1)Digit
Owner6
Group4
Others4

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 and write. Group and others can read.

chmod 644 file
chmod u=rw,g=r,o=r file

Common values

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

What 644 allows

WhoDigitOn a fileOn a directory
Owner6 rw-read and changesee the names, nothing more
Group4 r--readsee the names, nothing more
Others4 r--readsee the names, nothing more

ls -l shows this mode as -rw-r--r-- on a file and as drw-r--r-- on a directory.

The owner can edit the file, everyone else can read it, and nobody can execute it. A newly created file gets this mode under the common umask of 022.

Where it belongs

Documents, images, HTML and CSS, most configuration files: anything that is data and not a program. A web server only has to read the files it serves, so 644 is the usual mode for the files of a website, with 755 on the directories.

Where it is the wrong mode

  • On a directory. Without the execute bit nobody can enter it, the owner included. ls may still show the names, and opening anything inside fails. Directories want 755.
  • On a script. ./script.sh answers "Permission denied" until the execute bit is set, with chmod +x script.sh or 755.
  • On a secret. Everyone with an account on the machine can read a 644 file. Keys and passwords want 600.

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

See all 12