chmod permissions reference
The Linux file modes you will actually use, what each one allows, and when to pick it.
| Mode | Symbolic | Meaning |
|---|---|---|
| 400 | r-------- | Read-only for the owner and no access for anyone else. |
| 440 | r--r----- | Read-only for the owner and group. |
| 444 | r--r--r-- | Read-only for everyone. |
| 500 | r-x------ | The owner can read and run the file; nobody else has access. |
| 550 | r-xr-x--- | The owner and group can read and run the file, and nobody can write to it. |
| 555 | r-xr-xr-x | Everyone can read and run the file, and nobody can write to it. |
| 600 | rw------- | The owner can read and write; nobody else has access. |
| 640 | rw-r----- | The owner can read and write and the group can read. |
| 644 | rw-r--r-- | The owner can read and write, and everyone else can read. |
| 660 | rw-rw---- | The owner and group can read and write, and others have no access. |
| 664 | rw-rw-r-- | The owner and group can read and write, and others can read. |
| 666 | rw-rw-rw- | Everyone can read and write. |
| 700 | rwx------ | Only the owner can read, write and enter. |
| 710 | rwx--x--- | The owner has full access, and the group can enter the directory but not list it. |
| 711 | rwx--x--x | The owner has full access, and everyone else can enter the directory but not list it. |
| 750 | rwxr-x--- | The owner has full access, the group can read and run, and others have no access. |
| 755 | rwxr-xr-x | The owner can read, write and run, and everyone else can read and run. |
| 770 | rwxrwx--- | The owner and group have full access, and others have none. |
| 775 | rwxrwxr-x | The owner and group have full access, and others can read and run. |
| 777 | rwxrwxrwx | Everyone can read, write and run. |
| 1777 | rwxrwxrwt | Everyone can create files, but only a file's owner can delete or rename it. |
| 2755 | rwxr-sr-x | Like 755, with setgid: files created inside a directory inherit the directory's group. |
| 2775 | rwxrwsr-x | Like 775, with setgid. |
| 4755 | rwsr-xr-x | Like 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.