Courseiva
System SecuritymediumMultiple ChoiceObjective-mapped

LPIC-2 System Security Practice Question

An administrator wants to allow user 'john' to execute any command as root without a password. Which sudoers entry is correct?

⚠ Common exam trap

Test-takers frequently confuse the 'ALL' in the command specification with the 'ALL' in the host or runas fields, or forget that omitting 'NOPASSWD' defaults to requiring a password, leading them to choose option C.

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

john ALL=(ALL) NOPASSWD:ALL

The sudoers entry 'john ALL=(ALL) NOPASSWD:ALL' grants user 'john' permission to run any command as any user (including root) on any host, and the 'NOPASSWD' tag overrides the default password requirement, allowing execution without a password. The syntax follows the sudoers format: 'user host=(runas) TAG:command', where 'ALL' in each field matches any value.

Answer analysis

Option-by-option breakdown

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

  • john ALL=(ALL) NOPASSWD:ALL

    Why this is correct

    This allows john to run any command as any user without a password.

  • john ALL=(ALL) NOPASSWD:/bin/ls

    Why it's wrong here

    This only allows passwordless execution of /bin/ls, not all commands.

  • john ALL=(ALL) ALL

    Why it's wrong here

    This entry allows john to run any command but requires a password.

  • john ALL=(ALL) PASSWD:ALL

    Why it's wrong here

    The PASSWD tag requires a password, which is not desired.

About these practice questions

This LPIC-2 question is part of Courseiva's 507-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 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.