Step 6 of 8 · lab · 10 min
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:
deployhas the right to run any command through sudo, like an administrator, while the account itself stays an ordinary one with its own UID;- the sudo configuration stays valid:
sudo visudo -cpasses without errors, and files in/etc/sudoers.d/are owned byroot:rootwith mode0440.
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
The machine is starting
Hints
0 of 3Lab 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
Goals are checked on the machine after every command.