What chmod 744 means
| Who | Digit | Letters | On a file | On a directory |
|---|---|---|---|---|
| owner | 7 |
rwx |
Can read, modify and run | Can list files, create, delete and rename files and enter it and open files |
| group | 4 |
r-- |
Can read | Can list files |
| others | 4 |
r-- |
Can read | Can list files |
Each digit is the sum of read (4), write (2) and execute (1). In
ls -l output it looks like this:
$ ls -l
-rwxr--r-- 1 alice staff 1834 Oct 21 10:30 example.txt
- The owner can read, write and execute.
- The group can read.
- Everyone else can read.
When to use 744
- Scripts only the owner should run
- Files others may read but not execute
744 lets other users read a script but not run it directly. Anyone who can read a script can still run it with bash script.sh, though, so 744 is a convention rather than a security boundary. Use 700 if the contents are sensitive.
Is chmod 744 safe?
Yes, for scripts only the owner should run. Other users can read it, but can’t change it. Don’t use it for files that contain secrets.
Commands
# One file
chmod 744 file
# Same thing in symbolic form
chmod u=rwx,g=r,o=r file
# Every file under a tree (leaves directories alone)
find /path/to/dir -type f -exec chmod 744 {} +
# Check the result
stat -c '%a %A %n' file # Linux
stat -f '%Lp %Sp %N' file # macOS
Avoid chmod -R 744 on a whole tree: it gives files and directories the same mode. The
find form above changes only files.
Compare with similar modes
| Mode | Symbolic | Difference |
|---|---|---|
644 |
rw-r--r-- |
Lets the owner read and write, and everyone else only read |
444 |
r--r--r-- |
Lets everyone read, but nobody write or execute |
Other chmod values
777 · 775 · 770 · 755 · 751 · 750 · 711 · 700 · 666 · 664 · 660 · 644 · 640 · 600 · 555 · 500 · 444 · 400 · 000 · 1777 · 2775 · 4755
Need a different combination? Use the Chmod Calculator.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What does chmod 744 mean?
chmod 744 sets the permissions to rwxr--r--. The owner can read, write and execute. The group can read. Everyone else can read.
Is chmod 744 safe?
Yes, for scripts only the owner should run. Other users can read it, but can’t change it. Don’t use it for files that contain secrets.