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

I already know that I should:

  • run visudo
  • be logged in as root

But then what changes should I make to the sudoers file?

p.s. The question got 'down-voted'. Is this a bad question?! I looked at man sudoers, and there are several pages of explanation of everything to do with the sudoers file, most of it in Extended Backus-Naur Form. I want to know something much more specific and I don't have 3 hours to waste finding out how. In other words, I want a simple example for someone with not that much experience.

share|improve this question

closed as not a real question by Iain, womble, SmallClanger, RobM, pauska Jul 27 '11 at 9:42

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

man visudo, SEE ALSO section – reinierpost Jul 27 '11 at 7:45
You make whatever changes are required to effect the configuration change you wish to make. – womble Jul 27 '11 at 8:54
Your original question appears to suggest that you haven't invested any time in reading the manuals or other online resources. You haven't said what you want the user to do, full permissions on all commands all hosts, restricted use of particular command on one host. You could even have looked at the Questions with similar titles or the related questions that this system presents to you. You didn't, you chose to whine, the online community will be a better place without you. I have on many occasions pointed colleagues to the manuals too. – Iain Jul 27 '11 at 9:11
in respect to your p.s addition. what are you trying to do ?! I'm assuming you want to add a user to give them the ability to do what ? run every command through sudo ?? what ? The key problem word in "something much more specific" is "something" – Sirex Jul 27 '11 at 9:23

It's a bad question because you've given no information about what you're trying to achieve. Someone could say run "sudo visudo", append "#username" to the bottom of the file, save, done.

Do you want the user to be able run commands as root? With or without a password? The sudoers file is both flexible and complicated.

For simply allowing the user to run commands as root you would usually add them to a predefined group that is already in the file such as as "admin" or "sudo".


usermod -a -G admin username
share|improve this answer

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