Interview Prep/Linux/Permissions, Users & sudo

Explain this sudoers line: `%devops ALL=(ALL:ALL) NOPASSWD: /usr/bin/systemctl restart nginx`

IntermediateConceptPermissions, Users & sudo
Answer
  • %devops: members of group devops
  • ALL=: on any host
  • (ALL:ALL): may run as any user and any group
  • NOPASSWD:: without entering a password
  • the command: only exactly systemctl restart nginx

Specifying arguments restricts the command line exactly. Never grant editors, pagers, tar, find or shells this way, because they can spawn a root shell.

All Linux questions Roadmap: Linux

More on Permissions, Users & sudo