Signal9Signal9 — home
online
back to labs

Sudo: Grant a Limited NOPASSWD Privilege

MediumLinux Security20-25 min
The brief

A service operator account needs to run exactly one administrative command via sudo without being prompted for a password — and nothing more. Read /root/case/assignment.env for the account name (OPUSER) and the one absolute command path it may run (CMD). Create a sudoers drop-in under /etc/sudoers.d/ that grants that account NOPASSWD access limited to that single command, and make sure the sudo configuration still parses cleanly (a syntax error in sudoers can lock everyone out). Grading reads the durable sudoers policy, so the drop-in is what must be correct.

What you'll do
  • Grant the assigned account NOPASSWD sudo for exactly the assigned command
  • Keep the grant scoped — not a blanket ALL
  • Leave the sudo configuration syntactically valid (visudo -c passes)

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.