Chmod Calculator
Convert between octal, symbolic, and checkbox Unix file permissions. Supports setuid, setgid, and sticky bit.
Special Permissions
Quick Presets
Command Preview
chmod 755 filenamechmod u=rwx,g=rx,o=rx filenameWhat Are Unix File Permissions?
Unix and Linux filesystems attach a set of permission bits to every file and directory. These bits control who can read, write, or execute the item. There are three permission categories — Owner, Group, and Other — each with three independent flags: read (r), write (w), and execute (x).
The Owner is the user account that created the file. The Group represents a set of users who share access — for example, a www-data group that your web server process belongs to. Other covers everyone else on the system.
For directories, the execute bit has a special meaning: it controls whether a user can enter (traverse) the directory and list its contents. A directory without execute permission cannot be opened even if read permission is set.
View permissions with ls:
$ ls -la /var/www/html drwxr-xr-x www-data www-data html/ -rw-r--r-- www-data www-data index.html -rwxr-xr-x www-data www-data deploy.sh
When hosting with NetOz — whether on shared hosting, a VPS, or a dedicated server at our Adelaide facility in NextDC AD1 — web files typically use 644 and directories 755. This gives the web server process read access while preventing other users from modifying your files.
Understanding Octal Permission Notation
Octal (base-8) notation is the most compact way to express Unix permissions. Each of the three permission groups — owner, group, other — is represented by a single digit from 0 to 7, formed by adding up the bit values of the permissions granted:
| Permission | Binary | Value |
|---|---|---|
| Read (r) | 100 | 4 |
| Write (w) | 010 | 2 |
| Execute (x) | 001 | 1 |
| None | 000 | 0 |
So 755 means: owner gets read+write+execute (4+2+1=7), group gets read+execute (4+1=5), and other gets read+execute (4+1=5). In symbolic notation this is rwxr-xr-x.
Similarly, 644 means: owner gets read+write (4+2=6), group gets read only (4), other gets read only (4) — written as rw-r--r--.
Common chmod commands:
# Set web directory permissions
chmod 755 /var/www/html
# Set web file permissions
chmod 644 /var/www/html/index.html
# Recursively set directory permissions
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;Special Permissions: Setuid, Setgid, and Sticky Bit
Beyond the standard nine permission bits, Unix supports three special permission bits represented by an optional leading digit in four-digit octal notation.
Setuid (4) — chmod 4755 or chmod u+s
When set on an executable file, the program runs with the privileges of the file owner rather than the user executing it. The classic example is /usr/bin/passwd, which needs root access to modify /etc/shadow even when run by a regular user. Appears as rws (or rwS if execute is not set) in the owner field.
ls -la /usr/bin/passwd -rwsr-xr-x root root /usr/bin/passwd
Setgid (2) — chmod 2755 or chmod g+s
On an executable, setgid causes the program to run as the file's group. On a directory, new files created inside inherit the directory's group rather than the creator's primary group. This is especially useful for shared project directories where multiple users need consistent group ownership — for example, a shared web root where both developers and the web server belong to the same group.
chmod 2775 /var/www/shared ls -la drwxrwsr-x www-data www-data shared/
Sticky Bit (1) — chmod 1777 or chmod +t
Applied to a directory, the sticky bit restricts file deletion: only the file's owner, the directory's owner, or root can remove files within it, even if the directory is world-writable. The most well-known example is /tmp, which allows everyone to create files but prevents users from deleting each other's temporary files. Appears as t (or T) in the other execute position.
ls -la / drwxrwxrwt root root tmp/
On NetOz managed hosting and VPS environments, you may encounter setgid on shared directories to ensure consistent group ownership across deployments. If you are managing permissions on a server hosted at our Adelaide data centre or through our cPanel platform, the Web Server Config Generator and the Systemd Generator are complementary tools for configuring your Linux services correctly.