exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 67 discussion

Actual exam question from CompTIA's XK0-005
Question #: 67
Topic #: 1
[All XK0-005 Questions]

A Linux administrator created the directory /project/access2all. By creating this directory, the administrator is trying to avoid the deletion or modification of files from non-owners. Which of the following will accomplish this goal?

  • A. chmod +t /project/access2all
  • B. chmod +rws /project/access2all
  • C. chmod 2770 /project/access2all
  • D. chmod ugo+rwx /project/access2all
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
IFBBPROSALCEDO
5 months, 1 week ago
Selected Answer: A
This sets the sticky bit on the directory /project/access2all. The sticky bit ensures that only the owner of a file can delete or rename it within that directory, preventing non-owners from deleting or modifying files they do not own.
upvoted 2 times
...
e418137
9 months ago
Selected Answer: A
A. Just look for yourself: 'ls -ld /tmp'. This directory accomplishes the goal of the question. That was done in octal 'chmod 1777 /tmp' or in UGO shorthand 'chmod +t /tmp'. 2770 is the setGID bit, explained by DRVison.
upvoted 2 times
...
DRVision
11 months ago
Selected Answer: A
Option A, chmod +t /project/access2all, is better than option C, chmod 2770 /project/access2all, for preventing the deletion or modification of files from non-owners because of the following reasons: Sticky Bit: Option A sets the sticky bit on the directory. The sticky bit restricts deletion or renaming of files within the directory to the file owners, the directory owner, or the root user. This means even if a user has write permission to the directory, they cannot delete or rename files owned by others. Setgid and Permissions: Option C sets the setgid bit and gives the group read, write, and execute permissions. The setgid bit causes new files and directories created in the directory to inherit the group ownership of the directory, but it does not prevent file deletion or modification by non-owners. The permissions 770 give the owner and the group full permissions (read, write, execute), but they do not prevent file deletion or modification by non-owners who are in the group. Therefore, to specifically prevent deletion or modification of files from non-owners, option A is the better choice.
upvoted 3 times
...
Alizadeh
1 year, 2 months ago
Selected Answer: C
The correct answer is C. chmod 2770 /project/access2all.
upvoted 1 times
...
linux_admin
1 year, 8 months ago
Selected Answer: C
C. chmod 2770 /project/access2all. This option sets the setgid (chmod +2) and the permissions rwx (chmod 700) on the directory. This means that files created within the directory will inherit the group ownership of the directory, rather than the user's primary group, and members of the group will have full permissions to read, write, and execute files within the directory. Non-group members will not have access to the directory. This helps to ensure that files created within the directory can only be modified by members of the group and not by non-owners.
upvoted 2 times
tutita
1 year, 5 months ago
correct, the sticky bit only works for not deleting a file, the question states modify and delete the files hence is option C. chmod 2770
upvoted 1 times
tutita
1 year, 5 months ago
I meant to say, the sticky bit denies to other users the right to delete or RENAME a file. the question states "MODIFY and delete" for non-ownerS. Im guessing here by non ownerS means users that belong to a group. terrible wording but since its stating modify not rename Im going for C.
upvoted 1 times
...
...
linux_admin
1 year, 8 months ago
Answer A (chmod +t /project/access2all) sets the sticky bit on the directory, but this only affects the ability of regular users to delete files. The sticky bit does not prevent regular users from modifying files within the directory. To prevent modification of files within the directory by non-owners, you would need to set more restrictive permissions using chmod or using access control lists (ACLs). So, answer A is not the correct solution to the problem of preventing the modification or deletion of files within the directory by non-owners.
upvoted 1 times
BreakOff874
1 year, 8 months ago
You are wrong. The sticky bit does prevent users, other than the owner, to delete files. The question is asking for a solution that will prevent non- owner(groups and others) from deleting files. chmod +t will do the job. Answer C is giving rwx to groups (non-owner)
upvoted 5 times
...
...
...
Huckleberry
1 year, 9 months ago
restricted deletion flag or sticky bit (t).
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago