Free tool · No signup · Private

Chmod Calculator: Linux File Permissions Explained

Tick who can read, write and execute, or type an octal mode like 755 or a symbolic string like rwxr-xr-x, and get the exact chmod command. You can paste a line straight from ls -l, and it warns you before you make a file world-writable.

By Suman Sharma · Updated

Chmod calculator · Linux permissionsLocal
WhoReadWriteExecuteDigit
Owner (u)7
Group (g)5
Others (o)5
Special bits (setuid, setgid, sticky)
Command
chmod 755
-rwxr-xr-x · chmod u=rwx,g=rx,o=rx

How to use this tool

  1. Set the permissions

    Tick read, write and execute for the owner, group and others, or pick a preset like 644 or 755.

  2. Or convert what you have

    Type an octal mode, or paste the permissions column from ls -l, such as -rw-r--r--. Everything else updates to match.

  3. Copy the command

    Copy chmod in octal or symbolic form and run it in your terminal.

Example

A deploy script that won't run.

Input

  • ls -l shows: -rw-r--r-- deploy.sh
  • Error: Permission denied when running ./deploy.sh

Result

  • Current mode: 644 (owner can read and write, nobody can execute)
  • Tick Execute for owner, group and others: 755, rwxr-xr-x
  • Command: chmod 755 deploy.sh
  • Symbolic: chmod u=rwx,g=rx,o=rx deploy.sh

If only you should run it, chmod 744 deploy.sh (or chmod u+x deploy.sh) is enough.

How the numbers work

Each digit is one group of people: the file's owner, its group, and everyone else. Inside each digit, read is worth 4, write 2 and execute 1, and you add them up. So 7 is read + write + execute, 6 is read + write, 5 is read + execute and 4 is read only.

755 therefore means the owner can do everything, and the group and everyone else can read and execute. In symbolic form that's rwxr-xr-x.

What execute means for folders

On a directory, read lets you list its contents, write lets you create and delete files in it, and execute lets you enter it and reach the files inside. A folder needs execute to be usable at all, which is why directories are usually 755 or 700, and files 644 or 600.

The special bits

  • setuid (4xxx): a program runs as the file's owner instead of the person who started it. passwd uses this to update system files.
  • setgid (2xxx): on a program, it runs with the file's group; on a directory, new files inherit the directory's group, which is handy for shared project folders.
  • Sticky (1xxx): on a directory, only a file's owner can delete or rename it. /tmp is 1777 for this reason.
  • In ls -l output these show as s or t in the execute position, or S or T when execute isn't set.

Common chmod values

  • 777 (rwxrwxrwx): everyone can read, write and execute. Avoid it, especially on web servers.
  • 775 (rwxrwxr-x): owner and group can write; shared project folders.
  • 755 (rwxr-xr-x): directories, scripts and programs.
  • 750 (rwxr-x---): like 755 but hidden from everyone outside the group.
  • 700 (rwx------): private directories such as ~/.ssh.
  • 664 (rw-rw-r--): files a group edits together.
  • 644 (rw-r--r--): ordinary files, web pages, images, configs.
  • 640 (rw-r-----): config files with secrets that a service group needs to read.
  • 600 (rw-------): private keys, .env files, credentials.
  • 400 (r--------): read-only for the owner, e.g. an AWS .pem key.

Symbolic chmod commands

Besides numbers, chmod accepts letters. Pick who (u for owner, g for group, o for others, a for all), an operator (+ to add, - to remove, = to set exactly) and the permissions (r, w, x).

  • chmod u+x deploy.sh: let the owner run the script.
  • chmod go-w file: remove write access for group and others.
  • chmod a=r file: everyone can read, nobody can write or execute.
  • chmod -R u=rwX,go=rX dir: capital X adds execute only to folders and files that are already executable, which is the safe way to fix a whole tree.

Common errors

  • Using chmod 777 to fix a permission error

    777 lets every user on the machine change or replace the file. It usually hides the real problem: the wrong owner. Check ownership with ls -l and fix it with chown, then use 755 or 644.

  • SSH says your key's permissions are too open

    SSH refuses private keys that others can read. Use chmod 600 ~/.ssh/id_ed25519 for the key and chmod 700 ~/.ssh for the folder.

  • chmod -R 644 broke every folder

    Directories need execute, so a recursive 644 makes them impossible to open. Set them separately: find . -type d -exec chmod 755 {} + and find . -type f -exec chmod 644 {} +.

  • A capital S or T in ls -l

    It means setuid, setgid or the sticky bit is set but execute isn't. That's almost always unintended; tick execute, or turn the special bit off.

Frequently asked questions

What does chmod 755 mean?

The owner can read, write and execute; the group and everyone else can read and execute. It's the usual setting for directories, scripts and programs. In symbolic form it's rwxr-xr-x.

What does chmod 644 mean?

The owner can read and write; everyone else can only read. It's the standard for ordinary files like web pages, images and config files. Symbolic: rw-r--r--.

What's the difference between 755 and 775?

775 also gives the group write access, so other members of the file's group can change it. Use it for shared folders; use 755 when only the owner should write.

How do I make a file executable?

chmod +x file adds execute for everyone; chmod u+x file adds it only for you. In octal, a 644 file becomes 755 or 744.

What permissions should a private SSH key have?

600 (rw-------) for the key file and 700 for the ~/.ssh directory. SSH refuses to use a key that other users can read.

Is chmod 777 safe?

Almost never. It lets every user on the system change or replace the file. On a web server it can let an attacker who gets any foothold rewrite your code. Use 755 for folders and 644 for files instead.

What permissions should WordPress files have?

WordPress recommends 755 for folders and 644 for files, with wp-config.php tighter, such as 640 or 600, so other users on the server can't read your database password.

How do I change permissions for every file in a folder?

chmod -R applies a change recursively. To set folders to 755 and files to 644 in one go, use find: find dir -type d -exec chmod 755 {} + and find dir -type f -exec chmod 644 {} +.

Contact

Get in Touch

Want to call me? book a call and I'll respond in the available time slot. I will ignore all soliciting.