How do I add a user to the "sudo" group?
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?
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:
- How can I add a new user as sudoer using the command line?
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.
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"