The answer is that charlie must log out and log back in for the group change to take effect. This is because when a user is added to a group, the new group membership is only applied to new login sessions; the current shell retains the cached group list from when the user originally logged in. The `sudo -l` command checks the user’s current group memberships against the sudoers file, so it will not see the new ‘devops’ group until the session is refreshed. On the LFCS exam, this scenario tests your understanding of how Linux handles group membership caching—a common trap is assuming that a simple `newgrp` or `sg` command will fix it for `sudo`, but those only affect the current shell’s group set, not the cached credentials used by `sudo -l`. A reliable memory tip: think of group changes as “login-only luggage”—you have to check out and check back in to carry the new bag.
LFCS User and Group Management Practice Question
This LFCS practice question tests your understanding of user and group management. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Refer to the exhibit.
$ sudo cat /etc/group | grep devops
devops:x:3001:alice,bob
$ sudo cat /etc/sudoers.d/devops
%devops ALL=(ALL) /usr/bin/systemctl
$ ls -l /usr/bin/systemctl
-rwxr-xr-x 1 root root 100000 Jan 1 12:00 /usr/bin/systemctl
$ sudo -l -U alice
User alice may run the following commands on this host:
(ALL) /usr/bin/systemctl
$ sudo -l -U bob
User bob may run the following commands on this host:
(ALL) /usr/bin/systemctl
A user named 'charlie' has just been added to the 'devops' group. However, when 'charlie' runs 'sudo -l', no sudo entries are shown. What is the most likely cause?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "most likely"
Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Refer to the exhibit.
$ sudo cat /etc/group | grep devops
devops:x:3001:alice,bob
$ sudo cat /etc/sudoers.d/devops
%devops ALL=(ALL) /usr/bin/systemctl
$ ls -l /usr/bin/systemctl
-rwxr-xr-x 1 root root 100000 Jan 1 12:00 /usr/bin/systemctl
$ sudo -l -U alice
User alice may run the following commands on this host:
(ALL) /usr/bin/systemctl
$ sudo -l -U bob
User bob may run the following commands on this host:
(ALL) /usr/bin/systemctl
A
'charlie' is not listed by name in the sudoers file.
Why wrong: Membership in the devops group is sufficient; the sudoers rule uses %devops.
B
'charlie' must log out and log back in for the group change to take effect.
Correct: Group changes require a new login session to be recognized by PAM and sudo.
C
'charlie' is also a member of another group that restricts sudo.
Why wrong: No evidence of restriction; the group devops grants the privilege.
D
The systemctl command is not executable by 'charlie'.
Why wrong: The command has execute permissions for all (chmod 755).
E
The sudoers file has a syntax error.
Why wrong: No, sudo -l works for alice and bob, so syntax is fine.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
'charlie' must log out and log back in for the group change to take effect.
Option B is correct because when a user is added to a new group, the group membership is only applied to new login sessions. The `sudo -l` command checks the user's current group memberships, which are cached at login time. Since 'charlie' was added to the 'devops' group while already logged in, the new group membership is not reflected until 'charlie' logs out and logs back in, or uses `newgrp` or `sg` to start a new session with the updated groups.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
'charlie' is not listed by name in the sudoers file.
Why it's wrong here
Membership in the devops group is sufficient; the sudoers rule uses %devops.
✓
'charlie' must log out and log back in for the group change to take effect.
Why this is correct
Correct: Group changes require a new login session to be recognized by PAM and sudo.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
✗
'charlie' is also a member of another group that restricts sudo.
Why it's wrong here
No evidence of restriction; the group devops grants the privilege.
✗
The systemctl command is not executable by 'charlie'.
Why it's wrong here
The command has execute permissions for all (chmod 755).
✗
The sudoers file has a syntax error.
Why it's wrong here
No, sudo -l works for alice and bob, so syntax is fine.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates assume group changes are immediate for all processes, but Linux caches group membership at login time, so `sudo -l` reflects only the groups present when the session started.
Trap categories for this question
Command / output trap
The command has execute permissions for all (chmod 755).
Detailed technical explanation
How to think about this question
Under the hood, Linux stores group memberships in `/etc/group` and the kernel's credential structure (`struct cred`), which is populated at login by `pam_group` or `initgroups()`. The `sudo` command uses `getgroups()` to retrieve the user's current group set; this set is static for the session. A real-world scenario is when a DevOps engineer is added to the 'docker' group to run Docker commands without sudo; they must log out and back in for the group change to take effect, or they will still get 'permission denied' errors.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A practitioner preparing for the LFCS exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
User and Group Management — This question tests User and Group Management — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: 'charlie' must log out and log back in for the group change to take effect. — Option B is correct because when a user is added to a new group, the group membership is only applied to new login sessions. The `sudo -l` command checks the user's current group memberships, which are cached at login time. Since 'charlie' was added to the 'devops' group while already logged in, the new group membership is not reflected until 'charlie' logs out and logs back in, or uses `newgrp` or `sg` to start a new session with the updated groups.
What should I do if I get this LFCS question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.