Linux Labs

Users, permissions, and processes / Stage 8 of 13 · step 6 of 8

Grant sudo to a user

easy ~10 min
Not running Starting usually ~20 s
Report a problem

Situation

A new administrator has joined the team. The deploy account already exists, but sudo does not let it in: sudo -l -U deploy prints that deploy may not run sudo.

Task

Make it so that:

  1. deploy has the right to run any command through sudo, like an administrator, while the account itself stays an ordinary one with its own UID;
  2. the sudo configuration stays valid: sudo visudo -c passes without errors, and files in /etc/sudoers.d/ are owned by root:root with mode 0440.

sudo -l -U deploy checks deploy's rights. deploy has no password yet, so a call made as him — sudo -u deploy sudo -n … — asks for a password even with the rights in place: that is not a refusal.

The tools you need are already installed. There's no internet on this machine.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 2
  • User deploy has sudo rights — not checked yet
  • The sudo configuration passes visudo -c; files in /etc/sudoers.d are root:root with mode 0440 — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…