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…
Question
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)- A14% (3)
- B5% (1)
- C81% (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/idfalls underNOPASSWD:, notPASSWD:- no password needed. - B is wrong on two counts:
sudoprompts for the invoking user's password (jane's), never root's, and the line does require a password forfdisk- 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
Community Discussion
No community discussion yet for this question.