Server Fault is a question and answer site for system and network administrators. 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

Is it possible to allow a user to run a command using sudo, but prevent them from adding any arguments to the command?

For example, if I want a user to be able to run:


but not:

/sbin/mii-tool -r


share|improve this question
up vote 5 down vote accepted

The Fine Manpage sez:

you can specify "" to indicate that the command may only be run without command line arguments.

So in your case, you'd probably do something like:

ALL ALL=(root) /sbin/mii-tool ""

(Probably throwing in a NOPASSWD: for convenience)

share|improve this answer
Nice catch, had a hard time finding that myself – Hyppy Jul 31 '11 at 3:41
man sudoers, first result for 'argument'. Rocket science it ain't. – womble Jul 31 '11 at 3:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.