nerdexam
CompTIACompTIA

XK0-005 · Question #146

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

The correct answer is B: chmod 777 taxes. Joe, a member of the 'accounting' group, cannot write to the 'taxes' file because the file itself lacks group write permissions and the directory needs execute permission for group for certain write operations like creating/overwriting files.

Troubleshooting

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

Joe, a member of the 'accounting' group, cannot write to the 'taxes' file because the file itself lacks group write permissions and the directory needs execute permission for group for certain write operations like creating/overwriting files.

Common mistakes.

  • A. chmod g+x accounting adds execute permission for the group to the accounting directory, changing drwxrw-r-- to drwxrwxr--. While this makes directory traversal more robust and is part of what chmod 774 accounting does, it alone does not grant write permission to the existing taxes file.
  • C. chgrp taxes accounting is syntactically incorrect; chgrp expects a group name followed by a file or directory name.
  • D. chgrp accounting taxes would change the group ownership of taxes to accounting, but the file is already owned by the accounting group, so this command has no effect on permissions.
  • F. chmod u+x accounting adds execute permission for the owner (ann) to the accounting directory, but Ann already has execute permission, and this command does not affect Joe's ability to write to the file.

Concept tested. Linux file and directory permissions (chmod, chgrp)

Reference. https://linuxconfig.org/linux-file-permissions-with-chmod-chown-chgrp-and-umask-commands

Topics

#Linux Permissions#chmod#File System Access#User and Group Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions