A team shares the directory /srv/devshare on a multi-user Linux server. Every user should be able to create or modify their own files there, but no user should be able to delete or rename files that belong to someone else. The administrators do not want to use ACLs, and they are not worried about group inheritance for new files. Which single change to the directory best meets these requirements?
Remove group write permission with chmod g-w /srv/devshare
Mark the directory append-only using chattr +a /srv/devshare
Set the setgid bit on /srv/devshare (chmod g+s /srv/devshare)
Set the sticky bit on /srv/devshare (chmod +t /srv/devshare)
Applying the sticky bit (chmod +t) to a directory tells the kernel that only the directory's owner, the file's owner, or root may unlink or rename entries within that directory. Because the directory can still be world-writable, all users can create and edit their own files, yet they cannot remove or rename files created by others.
The setgid bit influences the group ownership of newly created files but does not stop users who have write permission on the directory from deleting each other's files.
Marking the directory append-only with chattr +a prevents anyone (including the file owner) from deleting or truncating files, which is more restrictive than required.
Removing group write permission would prevent users from creating files altogether, contradicting the stated need.
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 used?
Open an interactive chat with Bash
How is the sticky bit different from the setgid bit?
Open an interactive chat with Bash
Why is chattr +a too restrictive for this scenario?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
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 .