chmod permissions

Octal, symbolic and command

No database: AIMRAN doesn't store your files, text or results

What is chmod permissions?

On Linux and macOS every file has permissions that say who can read, modify or execute it. They're written with numbers like 755 or letters like rwxr-xr-x, and it isn't always easy to remember what each one means.

With this calculator you tick the read, write and execute boxes for the owner, group and others, and get the number and the chmod command ready to paste into the terminal.

How to use it

  1. Tick read, write and execute permissions for owner, group and others.
  2. Or type the octal or symbolic value directly.
  3. Turn on the special setuid, setgid or sticky bits if you need them.
  4. Enter the file or folder name and turn on “Recursive (-R)” if needed.
  5. Copy the generated chmod command.

Advantages

Technical details

Each permission group (owner, group and others) is encoded as one octal digit by adding read = 4, write = 2 and execute = 1. An optional fourth leading digit represents the special bits: setuid = 4, setgid = 2 and sticky = 1, for example 4755 or 1777. In symbolic notation, the special bits replace the x with s/S (setuid and setgid) or t/T (sticky), lowercase if execute is set. 3 or 4 octal digits are accepted, as well as 9-character strings or 10-character ones with the leading type, as shown by ls -l. The chmod command is generated in octal and letter notation, with the -R option to apply it recursively.

Frequently asked questions

What does chmod 755 mean?

The owner can read, write and execute (7) and the group and others can read and execute (5). It's the usual setting for folders and scripts: rwxr-xr-x.

What does chmod 644 mean?

The owner can read and write (6) and everyone else can only read (4): rw-r--r--. It's the typical permission for regular files, such as web pages.

Why is chmod 777 not recommended?

Because it gives write permission to every user on the system, which is a security risk. Use the minimum permission needed.

What is the sticky bit?

A special bit that, on a folder, prevents users from deleting other users' files. It's what /tmp has, with permissions 1777.

What permissions should a private SSH key have?

600 (rw-------): only the owner can read and write it. SSH rejects keys with more open permissions.

More Developers tools