nerdexam
LPI

102-500 · Question #21

Given the following excerpt of the sudo configuration: jane ANY=NOPASSWD: /bin/kill, /bin/id, PASSWD: /sbin/fdisk Which of the following statements are true? (Choose three.)

The correct answer is C. Jane can run /sbin/fdisk after specifying her password. D. Jane can run /bin/kill without specifying a password. E. Jane can run /bin/id without specifying her password. In this sudoers entry, NOPASSWD: applies to the commands listed after it (/bin/kill and /bin/id), while PASSWD: overrides that tag for /sbin/fdisk onward - so Jane runs kill and id freely (making D and E true), but must authenticate with her own password for fdisk (making C…

Administrative Tasks

Question

Given the following excerpt of the sudo configuration: jane ANY=NOPASSWD: /bin/kill, /bin/id, PASSWD: /sbin/fdisk Which of the following statements are true? (Choose three.)

Options

  • AJane can run /bin/id only after specifying her password.
  • BJane can run /sbin/fdisk after specifying root's password.
  • CJane can run /sbin/fdisk after specifying her password.
  • DJane can run /bin/kill without specifying a password.
  • EJane can run /bin/id without specifying her password.

How the community answered

(21 responses)
  • A
    14% (3)
  • B
    5% (1)
  • C
    81% (17)

Explanation

In this sudoers entry, NOPASSWD: applies to the commands listed after it (/bin/kill and /bin/id), while PASSWD: overrides that tag for /sbin/fdisk onward - so Jane runs kill and id freely (making D and E true), but must authenticate with her own password for fdisk (making C true).

Why the distractors fail:

  • A is wrong because /bin/id falls under NOPASSWD:, not PASSWD: - no password needed.
  • B is wrong on two counts: sudo prompts for the invoking user's password (jane's), never root's, and the line does require a password for fdisk - just the wrong one is described here.

Memory tip: Think of NOPASSWD: and PASSWD: as sticky mode switches - each tag overrides the previous one and applies to every command listed after it until another tag appears. Read left to right: NOPASSWD → kill, id (free); PASSWD → fdisk (locked). And remember: sudo always asks your password, not root's.

Topics

#sudo configuration#NOPASSWD directive#privilege escalation#password authentication

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice