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?
Mark the directory append-only using chattr +a /srv/devshare
Set the sticky bit on /srv/devshare (chmod +t /srv/devshare)
Remove group write permission with chmod g-w /srv/devshare
Set the setgid bit on /srv/devshare (chmod g+s /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...
IT & Cybersecurity Package Join Premium for Full Access