What does chmod 644 mean? File permissions for web servers and configs

By TechCompare · Updated · How we check

chmod 644 means rw-r--r--: the owner gets read and write access, while the group and others can only read. Use it for data files, and 600 for anything secret.

chmod 644 sets permissions to rw-r--r--: the owner can read and write, and the group and everyone else can only read. This is a common permission for static files on web servers, configuration files, documents, and files that shouldn't be directly executable or editable by others. An interpreter can still be told to read a 644 script explicitly, such as with bash script.sh.

Octal
644
chmod 644
Symbolic
rw-r--r--
Owner / Group / Others
Category
Common Permissions
Standard permissions

How this is calculated

In octal, 6 = 4+2+0 (read+write). 4 = 4+0+0 (read-only). 644 blocks direct execution through the file's execute bit and blocks writes by group and others, but it doesn't stop an interpreter from reading the file when explicitly invoked.

On a web server, the handler decides whether PHP or Python content is processed, while 644 prevents the file from being written by the web-server user in the others class. Paired with 755 on directories, 644 on files creates a sensible baseline for shared or web-facing systems.

Verdict

Use 644 for data files that others should be able to read but not change or run. The octal splits as 6 (4+2, read+write) for the owner and 4 (read-only) for both group and others.

Stripping the execute bit prevents the operating system from launching the file directly as a program, although a user can still pass readable content to an interpreter such as Bash.

The same logic explains why 644 is the wrong choice for files holding secrets: 'others' can read them, so SSH keys, .env files, and credential stores need to drop further to 600 where the group and others bits go to zero.

More CHMOD scenarios

Frequently asked questions

What's the difference between chmod 644 and 755?
644 removes the execute bit for everyone, so the operating system won't launch the file directly as a program. A readable script can still be passed explicitly to an interpreter. Use 644 for files that contain data and 755 for files meant to be directly run and for directories.
Is chmod 644 safe for files with secrets like passwords or API tokens?
No. 644 lets every user on the system read the file. For secrets, use chmod 600 (owner-only read+write) so only the file's owner can see the contents. If the secrets are read by a specific service account, change file ownership to that account after setting 600 permissions.
Why is 644 the default permission for newly created files?
It's the result of the standard umask 022. The file-creation mode is 0666 (rw-rw-rw-), and umask 022 strips the write bit for group and others, leaving rw-r--r-- (644). Many Linux distributions default to umask 022, which gives new files this mode.