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
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 accountingadds execute permission for the group on the directory, which is necessary for traversal, but it doesn't address the missing write permission on thetaxesfile itself. - C.
chgrp taxes accountingis syntactically incorrect; it attempts to change the group of theaccountingdirectory to a non-existent group namedtaxes. - D.
chgrp accounting taxesattempts to change the group of thetaxesfile toaccounting, but the file already belongs to theaccountinggroup, so this command has no effect on permissions. - F.
chmod u+x accountingadds execute permission for the user owner (Ann) of theaccountingdirectory, 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
Community Discussion
No community discussion yet for this question.