breakitdown

chmod calculator

Type 755, paste -rw-r--r-- from ls -l, or tick the boxes. Every form stays in sync, and you see what the mode means for a file and for a directory.

Try

chmod 755 = rwxr-xr-x: owner full access, everyone else read and execute.

Read 4Write 2Execute 1Digit
Owner (user)7
Group5
Others5
Special0
  1. 7
    Owner (user): 7 = 4 read + 2 write + 1 execute
  2. 5
    Group: 5 = 4 read + 1 execute
  3. 5
    Others: 5 = 4 read + 1 execute

On a file

  • Owner (user) read it, change it and run it as a program
  • Group read it and run it as a program
  • Others read it and run it as a program

On a directory

  • Owner (user) list the names inside, enter it and open files by name, create and rename and delete entries
  • Group list the names inside and enter it and open files by name
  • Others list the names inside and enter it and open files by name

chmod 755 filechmod u=rwx,go=rx filels -l → -rwxr-xr-x

What does a chmod command do to a mode?

Symbolic operations follow GNU chmod: X adds execute only to directories and files that already have it, and with no u, g, o or a the umask decides which bits + may set.

umask calculator

umaskNew filesNew directoriesumask -S
022644 rw-r--r--755 rwxr-xr-xu=rwx,g=rx,o=rx
002664 rw-rw-r--775 rwxrwxr-xu=rwx,g=rwx,o=rx
027640 rw-r-----750 rwxr-x---u=rwx,g=rx,o=
077600 rw-------700 rwx------u=rwx,g=,o=

New files start from 666 and directories from 777; the umask removes bits. Programs can ask for less (an SSH key is created 600 whatever the umask).

Permission modes, explained