Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How could I change the sudoers files in order to get both "networkadmingroup" (a group created by me) and the "admin" to use all the network-related commands but not the rest? This is my attempt:

Cmnd_Alias WEB = /usr/sbin/httpd, sudoedit /etc/httpd/, sudoedit /etc/init.d/networking

Cmnd_Alias NETWORK_ADMIN = /sbin/ifconfig, /sbin/iptables,WEB

%networkadmingroup ALL = NETWORK_ADMIN

If I log in with another user outside of those groups I am however allowed to use those commands. How can I unable them from using them?

share|improve this question

migrated from Dec 16 '12 at 19:59

This question came from our site for professional and enthusiast programmers.

You can do something like %othergroup ALL=(ALL) ALL, !NETWORK_ADMIN. This doesn't stop them from copying the commands somewhere else, though.

share|improve this answer

You must log in to answer this question.