Courseiva
System SecuritymediumMultiple ChoiceObjective-mapped

LPIC-2 System Security Practice Question

A company's security policy requires that all members of the 'developers' group be able to run the command 'systemctl restart httpd' as root using sudo, without being prompted for a password. Which sudoers entry achieves this?

⚠ Common exam trap

The trap here is that candidates often forget the '%' prefix for groups or omit the NOPASSWD: tag, mistakenly thinking the default behavior already suppresses passwords, or they use invalid syntax like curly braces or numeric UIDs without the proper '#' prefix.

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

%developers ALL=(root) NOPASSWD: /usr/bin/systemctl restart httpd

It uses the %group syntax to specify the 'developers' group, includes the NOPASSWD: tag to suppress password prompting, and specifies the exact command path and arguments (/usr/bin/systemctl restart httpd) as required by the sudoers policy. This matches the security requirement precisely.

Answer analysis

Option-by-option breakdown

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

  • %developers ALL=(root) /usr/bin/systemctl restart httpd

    Why it's wrong here

    Missing NOPASSWD directive, so password will be required.

  • %developers ALL=(root) NOPASSWD: /usr/bin/systemctl restart httpd

    Why this is correct

    Correct syntax: group, hosts, runas, NOPASSWD, command.

  • developers ALL=(root) NOPASSWD: /usr/bin/systemctl restart httpd

    Why it's wrong here

    Missing the '%' prefix, so it refers to a user named 'developers', not the group.

  • %developers ALL=(root) NOPASSWD: {/usr/bin/systemctl restart httpd}

    Why it's wrong here

    Curly braces are not valid sudoers syntax.

  • %developers ALL=(0) NOPASSWD: /usr/bin/systemctl restart httpd

    Why it's wrong here

    UID 0 is root but the command path might need to be exactly specified; however, the main issue is that using UID is not standard; use (root) instead.

About these practice questions

One of 507 original LPIC-2 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 LPIC-2 practice question is part of Courseiva's free LPI 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 LPIC-2 exam.