Ubuntu – How to 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?

Best Answer

  • 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: