Add a User as a Sudoer Using Ubuntu Linux Command Line Terminal

In order to add a User as a /etc/sudoer to run sudo commands on Ubuntu Linux, you can run the below command in the Terminal.

sudo adduser <user-name> sudo

Example:

# sudo adduser mike sudo

Adding user `mike' to group `sudo' ...
Adding user mike to group sudo
Done.
Sudoer Add New User Example Ubuntu Linux

Let's verify the /etc/sudoer file.

# getent group sudo

sudo:x:27:mike

Documentation: https://help.ubuntu.com/community/RootSudo#Allowing_other_users_to_run_sudo

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!