Courseiva
User and Group Management →mediumMultiple Choice

LFCS User and Group Management Practice Question

A company follows the principle of least privilege. Several developers need sudo access to run specific commands like systemctl and journalctl. What is the best practice for granting this access?

⚠ Common exam trap

Watch out — candidates often default to adding users to the 'sudo' or 'wheel' group for convenience, overlooking the principle of least privilege and the proper use of sudoers drop-in files for command-specific restrictions.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Create a new group 'devops', add developers to it, and create a sudoers drop-in file with rules for specific commands

It follows the principle of least privilege by creating a dedicated 'devops' group and using a sudoers drop-in file (e.g., /etc/sudoers.d/devops) to grant only specific commands like systemctl and journalctl. This avoids modifying the main /etc/sudoers file directly, which is error-prone, and ensures that developers have no more privileges than necessary. The drop-in file approach is the recommended best practice for maintainability and security.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use 'usermod -a -G sudo' for each developer and edit /etc/sudoers manually with visudo

    Why it's wrong here

    Adding developers to the sudo group grants unrestricted root via sudo, violating least privilege, and hand-editing sudoers does not scale. Group membership is the right approach when users genuinely need full administrative rights rather than command-scoped delegation.

  • ✓

    Create a new group 'devops', add developers to it, and create a sudoers drop-in file with rules for specific commands

    Why this is correct

    A dedicated group with a sudoers drop-in file scopes privileges to named binaries, satisfying least privilege without granting full root or editing the main sudoers file. Command-level rules let developers run systemctl and journalctl only, and group membership simplifies later revocation.

  • ✗

    Add all developers to the 'wheel' group and configure %wheel ALL=(ALL) ALL

    Why it's wrong here

    Granting %wheel ALL=(ALL) ALL gives unrestricted root via sudo, violating least privilege for developers who only need systemctl and journalctl. It is tempting because wheel membership is the standard full-admin pattern on RHEL-family systems, and would be correct where users genuinely require complete sudo rights.

  • ✗

    Edit /etc/sudoers directly to add each developer username with command restrictions

    Why it's wrong here

    Editing /etc/sudoers directly bypasses syntax validation and risks locking out sudo entirely; visudo exists to catch errors before saving. Direct edits are acceptable only in constrained environments where visudo is unavailable, which is not the case for a standard Linux server.

About these practice questions

This LFCS question is part of Courseiva's 406-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.