SuperDevTools

Chmod calculator for Linux permissions

Octal (755, 4755), symbolic (rwxr-xr-x or -rw-r--r-- pasted from ls -l) or chmod clauses (u=rwx,g=rx,o=rx or g+w).

755 · rwxr-xr-x
Presets
Tick the permissions
Who Readr = 4 Writew = 2 Executex = 1 Digit
Owneru 0
Groupg 0
Otherso 0
Special bits
Applied to
Octal notation
Symbolic notation (ls -l)
Octal command
Symbolic command

What these permissions allow

    Default permissions with umask

    New files (666 & ~umask)
    New directories (777 & ~umask)

    A chmod calculator that works both ways

    This chmod calculator turns Unix and Linux file permissions into every notation you are likely to need. Tick the boxes, type 755, or paste -rw-r----- straight from ls -l, and you get the "Octal notation", the "Symbolic notation (ls -l)", the "Octal command" and the "Symbolic command", each with a "Copy" button. Below, a plain-English summary says exactly who can do what. Nothing leaves your browser.

    How to use it

    1. Type into "Permissions to convert": an octal number (644, 4755), a 9 or 10 character symbolic string, or chmod clauses such as u=rwx,g=rx,o= or g+w.
    2. Or tick the "Tick the permissions" grid: Owner, Group and Others against Read, Write and Execute. The "Digit" column shows each row's value.
    3. Add a special bit if needed: setuid, setgid or sticky bit.
    4. Under "Applied to", pick "a file" or "a directory", because x means something different for each. Put your own name in "File name in the command".
    5. The "Presets" load 644, 755, 600, 700, 775, 664, 400, 1777 or 777 in one click.

    Reading Linux permissions

    Each permission has a value: read r = 4, write w = 2, execute x = 1. Add them up for each class. So 755 gives the owner 7 (4 + 2 + 1, rwx) and gives the group and others 5 (4 + 1, r-x): rwxr-xr-x. The symbolic version of the same command is chmod u=rwx,g=rx,o=rx file.

    InputResultTypical use
    644rw-r--r--HTML pages, images, readable config files
    -rw-r-----640a file only the web server's group may read
    600rw-------a private SSH key in ~/.ssh
    4755rwsr-xr-xa setuid program such as passwd
    1777rwxrwxrwta shared directory such as /tmp
    2644rw-r-Sr--setgid without execute: capital S

    On a directory, r lets you list the names inside, w lets you create or delete files in it, and x lets you traverse it. Without x you cannot cd into it, even with r. A lowercase s means setuid or setgid with execute; a capital S means the same bit without execute. The sticky bit works the same way with t and T.

    umask and default permissions

    The "Default permissions with umask" block uses 666 & ~umask for files and 777 & ~umask for directories. With the common umask 022, a new file gets 644 and a new directory gets 755. A umask of 027 gives 640 and 750; 077 gives 600 and 700. "Load into the grid" sends the result back to the calculator.

    Security: steer clear of 777

    777 lets every account on the machine change, replace or run the file. On shared hosting or a VPS, that is how one compromised script can tamper with your whole site. The tool shows a warning as soon as others have write access. The usual rule for a website is 644 for files, 755 for directories and 600 for anything holding a password.

    Frequently asked questions

    What is the difference between chmod 755 and chmod 644?

    755 adds execute permission for everyone, which directories and scripts need. 644 is enough for a file that only has to be read.

    Why is there sometimes a fourth digit, as in 4755?

    The leading digit holds the special bits: 4 for setuid, 2 for setgid, 1 for the sticky bit. 0755 and 755 are the same.

    Can I paste a line from ls -l?

    Yes. Paste the first 10 characters, for example drwxr-x---. The d switches the tool to "a directory" and the result is 750. A trailing dot or plus sign is accepted too.

    Why does chmod 755 not clear setgid on a directory?

    On Linux, chmod keeps the setuid and setgid bits of a directory when you give only three digits. To clear them, run chmod g-s dir or chmod 00755 dir.