Home / Articles / Linux Chmod Permissions Explained

Linux Chmod Permissions Explained

Published:

When a script reports permission denied, first identify which account runs it and which path it needs to access. Changing everything to 777 may hide the immediate error while giving unrelated users write access. A small, deliberate permission change is easier to understand and review.

Read the three permission groups

Ordinary mode bits describe the owner, group and others, in that order. Within each group, read contributes 4, write 2 and execute 1. Add the allowed bits to obtain one octal digit: 7 means rwx, 6 means rw-, 5 means r-x and 0 means no permissions. GNU’s mode structure reference describes these bits.

644 = rw-r--r--
755 = rwxr-xr-x
600 = rw-------
700 = rwx------

In the chmod calculator, enter 644 and select Convert permissions. Then enable the owner execute checkbox: the numeric value becomes 744. This is a useful way to see exactly which digit a checkbox changes before editing a real file.

Apply a mode to one known file

These commands assume you own the example files and have already checked their purpose:

ls -l ./report.txt ./backup.sh
chmod 644 ./report.txt
chmod 750 ./backup.sh
ls -l ./report.txt ./backup.sh

The report becomes owner-writable and readable by other users. The script becomes executable by its owner and group, with no access for others. A symbolic command such as chmod u+x ./backup.sh adds owner execute permission while preserving the other ordinary bits. The calculator accepts a complete symbolic mode such as rwxr-x---; a shell change expression such as u+x is a different input format.

Directories and special bits need separate thought

For directories, read lists names, execute allows traversal, and write permits directory-entry changes subject to other checks. A readable file can still be unreachable if a parent directory lacks traversal permission. Setgid on a directory helps new entries inherit its group; the sticky bit restricts deletion and renaming in shared directories. Setuid affects execution identity on supported executable files. See the chmod reference before changing special bits.

Investigate permissions without broad recursion

Review the ownership and modes along the full path, then make the smallest intended change. Avoid applying one recursive numeric mode to a mixed tree of scripts, data files and directories. Files and directories often need different access. ACLs, read-only mounts and security systems such as SELinux can also deny access even when the displayed mode looks sufficient.

The calculator explains a mode; it cannot inspect your server’s ownership, ACLs or policy. After changing a file, test the operation as the account that actually runs the application.

Tools used in this guide

Related technical guides