XK0-005 · Question #806
A systems administrator changed the file permissions on the myfile file: $ sudo chmod g+w myfile $ ls -l myfile -rwxrwxr-x 1 admin editors C 2022-10-13 10:45 myfile Then the administrator added an…
The correct answer is A. The user test needs to log out and log back in before editing the myfile file. On Linux, group membership changes in /etc/group take effect for a user only when a new login session is created. The kernel assigns the list of groups to a process at login time; running 'usermod -aG' updates the file but does not modify any currently active session's…
Question
A systems administrator changed the file permissions on the myfile file:
$ sudo chmod g+w myfile $ ls -l myfile -rwxrwxr-x 1 admin editors C 2022-10-13 10:45 myfile Then the administrator added an existing user test to the editors group:
$ sudo usermod -aG editors test However, the user test is still unable to edit the file. Which of the following solutions will fix this issue?
Options
- AThe user test needs to log out and log back in before editing the myfile file.
- BThe file is only writable by the root user, and the user test needs root permissions.
- CThe group for the user test needs to be reloaded by running sudo source /etc/group.
- DIn order to edit the file, additional permissions are required that the user test does not have.
How the community answered
(63 responses)- A90% (57)
- B3% (2)
- C2% (1)
- D5% (3)
Explanation
On Linux, group membership changes in /etc/group take effect for a user only when a new login session is created. The kernel assigns the list of groups to a process at login time; running 'usermod -aG' updates the file but does not modify any currently active session's credentials. The user 'test' must log out and log back in (or use 'newgrp editors' as a workaround) to gain the new group membership in their session. Option B is incorrect - the file shows group write permission for 'editors'. Option C ('sudo source /etc/group') is not a valid or effective command for this purpose. Option D is incorrect because the editors group already has write permission on the file.
Topics
Community Discussion
No community discussion yet for this question.