Explain this sudoers line: `%devops ALL=(ALL:ALL) NOPASSWD: /usr/bin/systemctl restart nginx`
IntermediateConceptPermissions, Users & sudo
Answer
%devops: members of group devopsALL=: on any host(ALL:ALL): may run as any user and any groupNOPASSWD:: 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.
More on Permissions, Users & sudo
Explain the rwx permission model for files and directories.BeginnerHow does octal notation work in chmod?BeginnerWhat does chown do and who can run it?IntermediateWhat is umask and how is the final permission calculated?IntermediateWhat is SUID and give a real example?IntermediateWhat does SGID do on files versus directories?Intermediate