Which file-system attribute prevents deletion of files in a directory that is world-writable?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which file-system attribute prevents deletion of files in a directory that is world-writable?

Explanation:
The key idea is controlling who can delete files inside a shared directory. In Unix-like systems, the sticky bit on a directory changes how deletion and renaming are handled. When the sticky bit is set on a directory that everyone can write to, only the file’s owner, the directory owner, or the root user can delete or rename files within that directory. This lets a directory be world-writable for collaboration or temporary storage while preventing users from deleting others’ files, which is exactly the behavior needed in a place like /tmp. The other options don’t implement this behavior in the same way. The setuid bit relates to running programs with elevated privileges, not directory entry deletions. The immutable attribute (set with special flags) would prevent changes to files themselves, which is broader than what’s described. ACL flags provide fine-grained permissions but aren’t the standard mechanism that enforces delete restrictions in a shared, writable directory in the way the sticky bit does.

The key idea is controlling who can delete files inside a shared directory. In Unix-like systems, the sticky bit on a directory changes how deletion and renaming are handled. When the sticky bit is set on a directory that everyone can write to, only the file’s owner, the directory owner, or the root user can delete or rename files within that directory. This lets a directory be world-writable for collaboration or temporary storage while preventing users from deleting others’ files, which is exactly the behavior needed in a place like /tmp.

The other options don’t implement this behavior in the same way. The setuid bit relates to running programs with elevated privileges, not directory entry deletions. The immutable attribute (set with special flags) would prevent changes to files themselves, which is broader than what’s described. ACL flags provide fine-grained permissions but aren’t the standard mechanism that enforces delete restrictions in a shared, writable directory in the way the sticky bit does.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy