Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

The following will allow newuser to run any commands anywhere? How can I prevent it by allowing the user to run certain commands only?


## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
newuser ALL=(ALL)       ALL
share|improve this question
up vote 5 down vote accepted

You can create a command alias for newuser e.g.

Cmnd_Alias    NEWUSER_CMDS = /path/to/cmd1, /path/to/cmd2, /path/to/cmd3

then use that as part of the user specification

share|improve this answer
On Ubuntu/Debian systems specifically, I noticed the notation: newuser ALL=(ALL:ALL) NEWUSER_CMDS This looks like the way SUDO users are defined on that platform through the VISUDO command. Does Fedora support this as well? – Richard Pascual Oct 1 '14 at 0:17
newuser ALL=(ALL)       /path/to/your/command

Read User Specification section in the man sudoers page for more details.

share|improve this answer

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.