chmod 1777 (rwxrwxrwt)
Everyone can create files, but only a file's owner can delete or rename it. This is the mode of /tmp.
rwxrwxrwtWho can do what
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | ✓ | ✓ |
| Group | ✓ | ✓ | ✓ |
| Others | ✓ | ✓ | ✓ |
- Owner can read, write and execute.
- Group can read, write and execute.
- Others can read, write and execute.
- Sticky: in a directory, only a file's owner can delete or rename it.
- Warning: anyone on the system can write to this.
Commands
Set the mode
chmod 1777 my-dir # same thing in symbolic form: chmod u=rwx,g=rwx,o=rwxt my-dir
In ls -l output, a file with this mode shows as -rwxrwxrwt and a directory as drwxrwxrwt.
Try a different mode
| Read | Write | Execute | Special | |
|---|---|---|---|---|
| Owner | ||||
| Group | ||||
| Others |
Octal Symbolic
Command