A security scan reveals that the /tmp directory on a multi-user Linux server has permissions drwxrwxrwx (0777). To bring the directory back into compliance with the Filesystem Hierarchy Standard (FHS) and ensure that ordinary users cannot delete files they do not own, which chmod command should the administrator run?
The /tmp directory is intended for temporary files that do not need to survive a reboot. It should be world-writable so every process can create temporary files, but it must also have the sticky bit set so that only the file owner (or root) can rename or delete each file. Setting the sticky bit is done by placing a leading "1" in the numeric mode, making the correct permission 1777 (displayed as drwxrwxrwt). Using 0777 leaves the directory world-writable without any protection; 2777 sets the SGID bit, which affects group ownership rather than deletion protection; 0755 removes write permission for non-owners, breaking many applications that rely on /tmp.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the sticky bit, and why is it important?
Open an interactive chat with Bash
What does the Filesystem Hierarchy Standard (FHS) specify for /tmp?
Open an interactive chat with Bash
What is the difference between chmod 1777 and chmod 2777?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .