nerdexam
CompTIACompTIA

XK0-005 · Question #1141

XK0-005 Question #1141: Real Exam Question with Answer & Explanation

The correct answer is B: chmod 777 taxes. To allow Joe, a member of the accounting group, to write to the taxes file in the accounting directory, both the directory and the file need appropriate group write and execute permissions. chmod 774 accounting grants rwx to the group on the directory, allowing Joe to traverse it

System Management

Question

Joe, a member of the accounting group on a Linux system, is unable to write a file called "taxes" in the accounting shared directory. The ownership and permissions on the directory and file are as follows: accounting drwxrw-r-- user = ann, group = accounting taxes -rw-r--r-- , user = ann, group = accounting Which of the following commands would allow Joe to write to the file? (Choose two.)

Options

  • Achmod g+x accounting
  • Bchmod 777 taxes
  • Cchgrp taxes accounting
  • Dchgrp accounting taxes
  • Echmod 774 accounting
  • Fchmod u+x accounting

Explanation

To allow Joe, a member of the accounting group, to write to the taxes file in the accounting directory, both the directory and the file need appropriate group write and execute permissions. chmod 774 accounting grants rwx to the group on the directory, allowing Joe to traverse it, and chmod 777 taxes grants rwx to the group on the file, allowing Joe to write to it.

Common mistakes.

  • A. chmod g+x accounting adds execute permission for the group on the directory, which is necessary for traversal, but it doesn't address the missing write permission on the taxes file itself.
  • C. chgrp taxes accounting is syntactically incorrect; it attempts to change the group of the accounting directory to a non-existent group named taxes.
  • D. chgrp accounting taxes attempts to change the group of the taxes file to accounting, but the file already belongs to the accounting group, so this command has no effect on permissions.
  • F. chmod u+x accounting adds execute permission for the user owner (Ann) of the accounting directory, which does not affect Joe's (group member) permissions.

Concept tested. Linux file and directory permissions

Reference. https://man7.org/linux/man-pages/man1/chmod.1.html

Topics

#Linux Permissions#chmod command#File System Management#Access Control

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions