


We use cookies to improve your experience
We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience.
7 sections · 43 items
| Code / Syntax | Description |
|---|---|
0 | No permission (---) |
1 | Execute only (--x) |
2 | Write only (-w-) |
3 | Write + execute (-wx) |
4 | Read only (r--) |
5 | Read + execute (r-x) |
6 | Read + write (rw-) |
7 | Read + write + execute (rwx) |
| Code / Syntax | Description |
|---|---|
755 | Owner: rwx, Group: r-x, Others: r-x (directories, executables) |
644 | Owner: rw-, Group: r--, Others: r-- (regular files) |
600 | Owner: rw-, Group: ---, Others: --- (private files) |
700 | Owner: rwx, Group: ---, Others: --- (private directories) |
777 | Everyone: rwx (avoid in production!) |
750 | Owner: rwx, Group: r-x, Others: --- (group-shared directory) |
640 | Owner: rw-, Group: r--, Others: --- (group-readable file) |
444 | Everyone: read-only |
| Code / Syntax | Description |
|---|---|
chmod u+x file | Add execute for owner |
chmod g+w file | Add write for group |
chmod o-r file | Remove read for others |
chmod a+r file | Add read for all (user, group, others) |
chmod u=rwx file | Set owner to rwx exactly |
chmod go= file | Remove all permissions for group and others |
chmod u+x,g+r file | Multiple changes in one command |
| Code / Syntax | Description |
|---|---|
u | User / owner of the file |
g | Group associated with the file |
o | Others (everyone else) |
a | All (user + group + others) |
| Code / Syntax | Description |
|---|---|
4000 (setuid) | Run as file owner (e.g., passwd command) |
2000 (setgid) | Run as group owner / inherit group on dirs |
1000 (sticky bit) | Only owner can delete files in directory (e.g., /tmp) |
chmod 4755 file | setuid + standard executable permissions |
chmod 2755 dir | setgid on directory |
chmod 1755 dir | Sticky bit on directory |
| Code / Syntax | Description |
|---|---|
chmod -R 755 dir/ | Apply recursively to directory and contents |
chmod --reference=ref file | Copy permissions from reference file |
chmod -v 644 file | Verbose mode (show changes) |
chmod -c 644 file | Report only when changes are made |
| Code / Syntax | Description |
|---|---|
755 for directories | Standard directory permissions |
644 for files | Standard file permissions |
600 for .ssh/id_rsa | SSH private key (required by SSH) |
700 for .ssh/ | SSH directory |
400 for .pem files | AWS/SSL private keys (read-only owner) |
666 for /dev/null | Device files (everyone read/write) |