exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 83 discussion

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

A Linux administrator needs every new file created on a directory to maintain the group permissions of the same directory. Which of the following commands would satisfy this requirement?

  • A. chmod o+s <directory>
  • B. chmod u+s <directory>
  • C. chmod +s <directory>
  • D. chmod g+s <directory>
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
DiaaEmara
2 years, 7 months ago
It sounds like you're describing the setgid bit functionality where when a directory that has it set, will force any new files created within it to have their group set to the same group that's set on the parent directory. $ sudo mkdir --mode=u+rwx,g+rs,g-w,o-rwx somedir $ sudo chown saml.apache somedir $ ll -d somedir/ drwxr-s---. 2 saml apache 4096 Feb 17 20:10 somedir/
upvoted 1 times
...
MeisAdriano
3 years, 4 months ago
Selected Answer: D
D is valid "chmod g+s <directory>" is equal to "setgid <directory>" This means that all NEW files (only new files and subdirectories) will have the same group of the directory that contains new files (rather of group of user made the file) https://unix.stackexchange.com/questions/182212/chmod-gs-command
upvoted 3 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 ...