Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
How do I add a user to the sudoers file?

I already know that I should:

  • run visudo
  • be logged in as root

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

I don't understand all the complexity of the sudoers file, and I don't want to understand it. Therefore I am only able to formulate my question in the language of a beginner: for example, I cannot say what hosts I want it to work on, because I don't understand what that means.

I want to run any command by prefixing it with sudo, then typing in my password. I don't want anything special, I just want the simple, most likely answer to this question. I want an expert to look at this question and think, 'He probably wants that.'

share|improve this question

marked as duplicate by Iain, womble, John Gardeniers, RobM, pauska Jul 27 '11 at 10:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5  
If you can't be bothered to learn then you aren't a professional see the faq. I thought you'd given up participation in online forums too? –  Iain Jul 27 '11 at 10:02
    
The previous question edit history is rather alarming, but this question is at least well formed, if a little inappropriate for the site. Also, this can be found via "add user to sudoers file" from google. –  Sirex Jul 27 '11 at 10:05
9  
If you don't want to understand the file you want to modify, which is pretty much a sure road to disaster, then I can only suggest you stop immediately and hand this over to someone with a much more professional attitude than the one you're displaying. –  John Gardeniers Jul 27 '11 at 10:19
    
I have to agree with John. If you don't understand something and don't want to understand it then don't modify it. –  RobM Jul 27 '11 at 10:27

1 Answer 1

most sudoers files start out with a line in them that looks like this:

## Allow root to run any commands anywhere 
root    ALL=(ALL)   ALL

so you want to add a line like this:

<USERNAME> ALL=(ALL) ALL

if you use visudo it wont let you save the file if you have the syntax incorrect.

It's likely you dont need to edit the sudoers files at though as you should also have a line like this

## Allows people in group wheel to run all commands
# %wheel    ALL=(ALL)   ALL

So just add the user to the group

share|improve this answer

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