Kitloft

All tools / References

chmod permissions reference

The Linux file modes you will actually use, what each one allows, and when to pick it.

ModeSymbolicMeaning
400r--------Read-only for the owner and no access for anyone else.
440r--r-----Read-only for the owner and group.
444r--r--r--Read-only for everyone.
500r-x------The owner can read and run the file; nobody else has access.
550r-xr-x---The owner and group can read and run the file, and nobody can write to it.
555r-xr-xr-xEveryone can read and run the file, and nobody can write to it.
600rw-------The owner can read and write; nobody else has access.
640rw-r-----The owner can read and write and the group can read.
644rw-r--r--The owner can read and write, and everyone else can read.
660rw-rw----The owner and group can read and write, and others have no access.
664rw-rw-r--The owner and group can read and write, and others can read.
666rw-rw-rw-Everyone can read and write.
700rwx------Only the owner can read, write and enter.
710rwx--x---The owner has full access, and the group can enter the directory but not list it.
711rwx--x--xThe owner has full access, and everyone else can enter the directory but not list it.
750rwxr-x---The owner has full access, the group can read and run, and others have no access.
755rwxr-xr-xThe owner can read, write and run, and everyone else can read and run.
770rwxrwx---The owner and group have full access, and others have none.
775rwxrwxr-xThe owner and group have full access, and others can read and run.
777rwxrwxrwxEveryone can read, write and run.
1777rwxrwxrwtEveryone can create files, but only a file's owner can delete or rename it.
2755rwxr-sr-xLike 755, with setgid: files created inside a directory inherit the directory's group.
2775rwxrwsr-xLike 775, with setgid.
4755rwsr-xr-xLike 755, with setuid: the program runs with its owner's privileges.

Each digit is a sum: 4 for read, 2 for write and 1 for execute. The three digits are for the owner, the group and everyone else. An optional leading digit sets setuid (4), setgid (2) and the sticky bit (1). Work out any other mode with the chmod calculator.