Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In /etc/sudoers I see this:

# Allow members of group sudo to execute any command after they have
# provided their password
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL

So how do I add a user to that sudo group?

share|improve this question

5 Answers 5

up vote 93 down vote accepted
sudo usermod -aG sudo <username>

The a is very important. Without it they'll be removed from all other groups. You will need to either restart your shell/terminal or log out and back in for this to take effect.

See also:

share|improve this answer
    
I did what u recommended, but terminal told me bash: sudo: command not found, why? –  Teifi Jan 21 '13 at 12:23
    
@Teifi, that means you probably don't have sudo installed or, for some weird reason, it's not in your path. What happens when you run which sudo? –  maxmackie Jan 22 '13 at 16:33
    
New terminals were not enough. Ended up rebooting for another reason and now it works. Probably log-out/in. –  deed02392 Jul 8 at 15:35

You can either use the user management GUI for it (same place where you create users), or use sudo adduser <username> sudo in the command line.

share|improve this answer
    
This is also referred to in the ubuntu documentation on RootSudo albeit they refer to the admin group instead of the sudo group –  icc97 Mar 5 '12 at 8:27
2  
+1: this is the most easy-to-remember, simple and intuitive way to add a user to a group! –  Andrea Corbellini Dec 28 '12 at 17:14

You can also use a graphical interface. Click on the gear on the top right of the panel, then select "System Settings" and then "User Accounts"

You need to click the little unlock button to be able to edit things in this window. Then click on the person's account and select the proper dropdown for "Account Type"

enter image description here

share|improve this answer
    
I have Ubuntu 10.10 but my graphic interface is someway locked. It opens but I when buttons are pressed nothing happens. I suppose is something related to the privileges (I'm actually sudoer). How can I solve this issue? –  linello Jan 18 '13 at 9:49
    
Did you click the 'unlock' button? –  DaboRoss Jun 10 '13 at 2:22

Its really simple if you are using Unity as your desktop environment.

If you have created a user already then you can simply change it from Standard to Administrator, else make sure that you selected Administrator when creating a new one.

Don't forget to unlock before trying to change it

enter image description here

share|improve this answer
1  
Very cool looking GIF animation! +1 How did you do it? Moved the question here. –  hhh Dec 30 '12 at 0:58
    
askubuntu.com/a/123515/25863 –  Bruno Pereira Dec 30 '12 at 4:58

sudo gpasswd -a $USER sudo

share|improve this answer

Your Answer

 
discard

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.