This question already has an answer here:

To designate a user as an administrator from the GUI, you can simply open-up that user's properties and select the Account type as the "Administrator" option.

enter image description here

If the user already exists, what effect does selecting this account type have at the system level? (added to sudo group, modification to /etc/passwd or /etc/sudoers...etc)

And how would I accomplish this (designating a user as an "Administrator") from the command line?

marked as duplicate by Glutanimate, user83046, rɑːdʒɑ, Eric Carvalho, Basharat Sialvi Apr 14 '13 at 15:14

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.


For Ubuntu prior to 12.04 assuming the user already exists

sudo  adduser username admin

For 12.04 and later

sudo  adduser username sudo 

Replace username with the name of the user.

If you check the sudoers file sudo cat /etc/sudoers you will see this (from 12.04) or similar

# This file MUST be edited with the 'visudo' command as root.
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
# See the man page for details on how to write a sudoers file.
Defaults    env_reset
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

The line %sudo ALL=(ALL:ALL) ALL says members of the sudo group have administration privileges. The commands at the beginning of this answer add the user to the sudo or admin group as appropriate for the version of Ubuntu you are using. There is more information here:

RootSudo - Community Ubuntu Documentation.

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