Create a world-writable shared directory and apply the sticky bit so users can write freely but cannot delete files they do not own. Validate correct permissions by inspecting the directory mode and interpreting the sticky-bit indicator.
Your team needs a shared drop directory where multiple users can write files during a handoff workflow.
The directory must be world-writable to avoid permission friction, but you must prevent users from deleting
or renaming files they do not own. This is the exact problem the sticky bit solves (for directories like /tmp).
If a shared directory is writable by many users without the sticky bit, anyone can delete anyone else’s files. Sticky bit makes the directory safe for “shared write” use cases.
/tmp/shared.mkdir -p.
chmod using both symbolic and octal modes.
ls -ld and interpreting the t indicator.
mkdir -p /tmp/shared
-p ensures the directory is created without errors if it already exists.
Using /tmp keeps the scenario aligned with real-world sticky-bit use (like /tmp itself).
# Directory exists:
ls -ld /tmp/shared
chmod 777 /tmp/shared
# OR
chmod a+rwx /tmp/shared
World-writable permissions enable shared writes. On their own, this is unsafe because it allows arbitrary deletion. The sticky bit is the safety control that makes this pattern acceptable.
# Expect rwx for user/group/other:
ls -ld /tmp/shared
chmod +t /tmp/shared
# OR
chmod 1777 /tmp/shared
Sticky bit on a directory means files can only be deleted or renamed by the file owner, the directory owner, or root.
This is why /tmp is typically 1777.
# Confirm sticky bit (t) is present:
ls -ld /tmp/shared
ls -ld /tmp/shared
The sticky bit appears as a t in the “other execute” position for directories (for example drwxrwxrwt).
That single character is your fast confirmation that the directory is safe for shared write use.
drwxrwxrwt 2 root root 4096 Jul 18 15:04 /tmp/shared
# With sticky bit set:
# - Users can create files in /tmp/shared
# - Users cannot delete/rename files they do not own
# Without sticky bit:
# - Any user with write permission on the directory can delete others' files
This is the key mental model. Sticky bit does not block reading or writing into files by itself. It controls deletion and rename operations at the directory level for shared-write directories.
mkdir -p
: Creates directories and does not error if the target already exists.
chmod 777 <dir>
: Makes a directory world-writable (shared-write).
chmod +t <dir>
: Sets the sticky bit on a directory.
chmod 1777 <dir>
: Octal form for world-writable + sticky bit (common for /tmp-style dirs).
ls -ld <dir>
: Shows directory permissions; sticky bit appears as t (for example drwxrwxrwt).