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

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap