exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 119 discussion

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

A member of the production group issues the following command: echo "Monday through Friday" > /production_docs/days
The command fails to execute, so the user obtains the following output: drwxr--r-- root production 0 Jun 16 2018 production
-rw-r--r-- production production 4096 Jun 14 2018 days
Which of the following commands should the user execute to BEST fix the issue?

  • A. chmod g+w production to change the permissions on the days file
  • B. chgrp root production_docs/days to change the group ownership of the production_docs/days file
  • C. chmod g+S production to set the GUID on the production_docs directory
  • D. chown production to change the ownership of the production_docs directory
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
examtopics_htc
2 years, 6 months ago
A member of the production group tries to write to a file, but can't. So... just chmod g+w on the file. B and D are false, the file is already owned by the production group, that group just needs write permissions. C is false. The permissions of the directory doesn't have write access for the group either, so chmod +S will not help.
upvoted 1 times
...
edwram
2 years, 6 months ago
Selected Answer: A
A is correct
upvoted 3 times
...
Dracolitch
3 years, 3 months ago
I hate this question, but I hate all the wrong answers as well. To show you how garbage this question and all the answers are do this in your CLI. $ mkdir production_docs $ mkdir ./production_docs/production $ touch ./production_docs/days $ sudo groupadd production $ sudo useradd Production $ sudo usermod Production -G production $ sudo chown Production:production ./production_docs/days $ sudo chown root:production production_docs $ sudo chown root:production ./production_docs/production $ cd production_docs $ chmod go-x production $ sudo usermod <yourUSERname> -G production $ newgrp production $ echo "blah" > days zsh: permission denied: days Now you are free to test the answers CompTIA says should solve the issue... they all fail. The correct answer would be (with root permission) chmod g+w days. Anyway thats my 2 pennies...
upvoted 4 times
...
DBB73
3 years, 6 months ago
Horrible question and admin, having a USER and GROUP being named production, as well as not being consistent with _docs. No wonder this question is here and not on the test lol. This is what we have: A: Adds the group write permission to the directory. B: Changes group ownership of file days to root. C: Adds sticky bit to production directory. D: Change the user ownership of the directory to production. Ok, so B and C we can eliminate. B-if we change group ownership to root, no one can get the file & C-a sticky bit is for special user permissions to prevent others from deleting files. In order to even list the directory contents, the group member needs group x (execute) permissions on the production_days folder. You would think that A would help, but without the x permission, adding the write permission doesn't help, so A is not our answer. Changing the user ownership to production doesn't help either because we need GROUP permissions changed. So NO ANSWER is actually correct. IF answer A is changed to chmod g+wx production_days, I think we would get there.
upvoted 1 times
Didi31
3 years, 3 months ago
Did you find some questions that were on the test from this? I am taking mine this weekend.
upvoted 1 times
...
...
rjrpaz
3 years, 12 months ago
D is not correct. The uses is a member of the "production group", but is not the "production" user. So even if "D" allows to make modification into the directory, it still don't allow to overwrite the file, because the only user allowed to overwrite the file is user "production", but not the rest of the members of the "production" group.
upvoted 1 times
...
trusteme
4 years, 3 months ago
Can somebody explain?
upvoted 1 times
dansecu
4 years, 2 months ago
Correct answer is D Explanation: The production group member is not allowed to modify the file because the owner of the directory is root and for group production is missing execute permission which is allowing to see inside directory and reach to file: -rw-r--r-- . Solution: change the directory owner from root to production or add execute permission to production group. A: is adding group w perm to directory not file – it will not help B: is adding the group membership “root” to file – it will not help C: is adding group special permission S to the directory, that means all new files created in directory belongs to group but this is not applied to existing files – it will not help D: is changing the owner of the directory – it will help
upvoted 8 times
...
...
ssc1982
4 years, 4 months ago
A the uses in the product group have no write right.
upvoted 1 times
ssc1982
4 years, 4 months ago
The answer should be D, A the command is invalid.
upvoted 1 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