Linux+ XK0-004 Exam: Shared Directory Permissions | CompTIA Linux+ Exam

Shared Directory Permissions

Question

An administrator needs to create a shared directory in which all users are able to read, write, and execute its content but none of the regular users are able to delete any content.

Which of the following permissions should be applied to this shared directory?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

The correct answer to the question is D. rwxrwxrw*.

Explanation:

In Linux, file and directory permissions are represented by a 10-character string consisting of three sets of permissions: user permissions, group permissions, and other permissions. Each set of permissions consists of three characters representing read, write, and execute permissions, respectively. The permission character '-' means that the permission is denied, while the permission character 'r', 'w', or 'x' means that the permission is granted.

The permission character '*' is a special permission called the "sticky bit." When applied to a directory, the sticky bit prevents users from deleting files that they do not own, even if they have write permission on the directory.

Therefore, the permission string rwxrwxrw* means that the owner and members of the group associated with the directory have full read, write, and execute permissions, and all other users have read and write permissions but cannot delete files they do not own.

Option A (rwxrwxrwt) includes the "t" permission, which is the "sticky bit" for temporary files. This would not be suitable for a shared directory.

Option B (rwxrwxrws) includes the "s" permission, which is the setuid or setgid bit. This would not be suitable for a shared directory.

Option C (rwxrwxrwx) gives all users full read, write, and execute permissions, including the ability to delete files. This would not satisfy the requirement of the question.