exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 54 discussion

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

Ann, a junior systems administrator, is required to add a line to the /etc/yum.conf file. However, she receives the following error message when she tries to add the line:

Ann performs some diagnostics to attempt to find the root cause:

Which of the following commands should Ann execute to write content to /etc/yum?

  • A. chmod 755 /etc/yum.conf
  • B. setfacl ג€"m m:rw /etc/yum.conf
  • C. chattr ג€"i /etc/yum.conf
  • D. setenforce 0
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
ola_mb
Highly Voted 4 years, 4 months ago
C. you need to change the immutable attribute using the chattr -i command
upvoted 12 times
o0o0
3 years, 11 months ago
Exactly! The immutable bit set (i) discovered with the lsattr (list/display the file attributes) command confirms the fact that the administrator, event with privilege user, can not delete the given file. The solution is to use, still with the privilege user, the chattr (change the file attributes) command with the -i switch.
upvoted 3 times
...
...
BbyWiz
Most Recent 2 years, 4 months ago
Selected Answer: C
C. Also Ann shouldn't be directing '>' output to a .conf file
upvoted 1 times
...
xeun88
2 years, 6 months ago
change the immutable attribute using the chattr The Answer is C
upvoted 1 times
...
andrewdh
3 years, 1 month ago
A. chmod 755 /etc/yum.conf B. setfacl -m m:rw /etc/yum.conf C. chattr -I /etc/yum.conf D. setenforce 0
upvoted 2 times
...
petercorn
3 years, 4 months ago
Selected Answer: C
chattr changes the file attributes on a Linux file system. The format of a symbolic mode is +-=[aAcCdDeFijPsStTu]. The operator '+' causes the selected attributes to be added to the existing attributes of the files; '-' causes them to be removed; and '=' causes them to be the only attributes that the files have. The letters 'aAcCdDeFijPsStTu' select the new attributes for the files: append only (a), no atime updates (A), compressed (c), no copy on write (C), no dump (d), synchronous directory updates (D), extent format (e), case-insensitive directory lookups (F), immutable (i), data journalling (j), project hierarchy (P), secure deletion (s), synchronous updates (S), no tail-merging (t), top of directory hierarchy (T), and undeletable (u).
upvoted 1 times
...
J_Dawg
3 years, 7 months ago
C. But also, Ann shouldn't be using > to ADD a line to the conf file!! It will overwrite the whole file with that one input.
upvoted 2 times
...
Anon_7567
4 years, 3 months ago
I think it should be D, because chattr -i doesn't exist according to the manpage on my ubuntu system and SELinux is the only thing that stop root from running things
upvoted 1 times
miky_Cissp
4 years, 1 month ago
-i here is not an option for the command chattr."-" here is a minus and not a hyphen. That is why it does not appear in the man page. -i removes the immutable on the file thus it becomes editable, I vote for C.
upvoted 3 times
...
...
alfre
4 years, 4 months ago
C. chattr ""i /etc/yum.conf
upvoted 2 times
...
alfre
4 years, 4 months ago
right answer is C
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