Linux Labs

Users, permissions, and processes / Stage 8 of 13

Delegating commands with sudo

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 8 · lab · 10 mineasy

Grant sudo to a user

The new administrator deploy needs sudo rights. Set up access the proper, safe way.

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.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 2
  • User deploy has sudo rights — not done yet
  • The sudo configuration passes visudo -c; files in /etc/sudoers.d are root:root with mode 0440 — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

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

Lab goals

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