Skip to Main Content
Linux Security Cookbook
book

Linux Security Cookbook

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
June 2003
Intermediate to advanced content levelIntermediate to advanced
336 pages
8h 54m
English
O'Reilly Media, Inc.
Content preview from Linux Security Cookbook

5.7. Granting Privileges to a Group via sudo

Problem

Let a set of users run commands as another user.

Solution

Define a Linux group containing those users:

               /etc/group:
mygroup:x:1200:joe,jane,hiram,krishna

Then create a sudo rule with the %groupname syntax:

               /etc/sudoers:
# Let the group run a particular program:
%mygroup  ALL = (root) /usr/local/bin/mycommand arg1 arg2
# Give full superuser privileges to the group
%mygroup  ALL = (ALL) ALL

See Also

sudo(8), sudoers(5), group(5).

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Administration Cookbook

Linux Administration Cookbook

Adam K. Dean

Publisher Resources

ISBN: 0596003919Errata Page