Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » Add a User to the Sudoers List in Linux
  • ddwwdw
    How to query a list of installed programs in Windows Windows Server
  • dns records
    What are the different types of DNS Records Windows Server
  • Capture 2
    MDT Invalid credentials: The network was not found Windows
  • windows admin center banner 825x400 1
    Fix failed to create new Scheduled Task RemoteException Windows Server
  • youtube cover blue
    How to use the Azure Cloud Shell or Azure CLI and Azure PowerShell AWS/Azure/OpenShift
  • Remote Desktop Connection
    Connect to the Remote Desktop Console from Command Prompt Windows
  • wordpresserrorsiteadmin
    There has been a critical error on this website please check your site admin email inbox for instructions Web Server
  • How to create a Recovery Partition in Microsoft Windows
    How to create a Recovery Partition in Microsoft Windows 10/11 Windows

Add a User to the Sudoers List in Linux

Posted on 15/01/202318/03/2023 Imoh Etuk By Imoh Etuk No Comments on Add a User to the Sudoers List in Linux
Add-User-to-Sudoers

As system administrators, performing some administrative tasks on our PC is crucial. However, it must be noted that while it is crucial to perform administrative tasks using the superuser do command (Sudo). It has the overall administrative power on your PC. This command must be used with caution so as to prevent accidental deletion and destruction of your PC. Learn how to add a User to the Sudoers List in Linux. Here are some interesting guides: How to Switch between Users in Linux, how to use Systemd Timers on Linux, how to Install PlayonLinux on a Linux System, How to install WireShark on a Linux Ubuntu System, and how to Create Symbolic Links in Linux.

Sudo, which stands for “superuser do” or “substitute user do,” is a command that allows you to run an elevated prompt without changing your identity. It is one of the most crucial commands you can use as a Linux system administrator or power user. Depending on your settings in the /etc/sudoers file, you can issue single commands as root or as another user. You can grant common users administrative access by adding them to the sudoers list.

By doing this, you can avoid having to disclose your system’s root password to other users. Users who have been added to the sudoers list can run system commands as root.

You have the ability as the root or superuser to perform functions such as installing and installing files, deleting any or all files, modifying the permissions of one or more files, and even deleting and modifying other users. Root users can also modify the system’s run level and create, change, or delete file systems.

How to add Users to the Sudoers Group

Let’s assume that you have a list of users that you wish to add to the Sudoers list already created.

Note: Before you can add a user to the sudoers list, you must first create the user. 

The steps to add users to the sudoers list are:

1. Create a New User

To create a new user, run the below command in your terminal:

sudo adduser <user name> or sudo useradd <user name>
Adding-a-user-in-Linux
Creating a New User

From the screenshot above, we create a new user tova with the adduser command. Notice that the user was assigned the user id of 1006 and added to a group named tova with the group id of 1004 and we were also prompted to supply the user details such as full name, room number, work/home phone number and so on.

Note: Adding a user with the "sudo useradd <user name>" will not prompt to supply user details but adds user automatically.

To view the user list, run:

sudo cat /etc/passwd
List-of-user
Viewing user list

2. Adding a User to the Sudoer Group

Let’s take a look at the groups we have already in our system by running the below command:

sudo cat /etc/group
Viewing-the-list-of-groups
Viewing list of Groups

As you can see, we have the sudo the group listed in the above screenshot.

Now, let’s add the user tova we created previously to the sudo group using the below command:

sudo adduser tova sudo
Added-a-user-to-Sudo-group
Adding a user to the Sudoer Group

Finally, run the sudo cat /etc/group command to verify that the user has been added to the Sudoer group successfully.

Viewing-the-list-of-groups1
User Added to the Sudeors Group

The user tova is rightly added to the Sudoers group.

I hope you found this blog post helpful. You have learned how to add a User to the Sudoers List in Linux. If you have any questions, please let me know in the comment session.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Linux Tags:sudo, Ubunt 20.04 LTS, Ubuntu

Post navigation

Previous Post: Performance and Diagnostics in Microsoft Cloud with Azure Monitor
Next Post: Azure Hybrid Use Cases and Benefits

Related Posts

  • HAProxy
    Deploying a load balancer from scratch and adding backend servers Linux
  • featureunions
    How to Install Unison on Linux System Linux
  • Webp.net resizeimage 1
    Automate Infrastructure Deployments in the Cloud with Ansible and Azure Pipelines AWS/Azure/OpenShift
  • Rport
    RPORT the free and open source remote management tool Linux
  • linux tux minimalism 4k 42 2560x1700 1 1
    Warning useradd: the home directory already exists. Not copying any file from skel director into it Linux
  • screenshot 2020 05 05 at 22.42.35
    How to run Windows applications on Linux via WineHQ Linux

More Related Articles

HAProxy Deploying a load balancer from scratch and adding backend servers Linux
featureunions How to Install Unison on Linux System Linux
Webp.net resizeimage 1 Automate Infrastructure Deployments in the Cloud with Ansible and Azure Pipelines AWS/Azure/OpenShift
Rport RPORT the free and open source remote management tool Linux
linux tux minimalism 4k 42 2560x1700 1 1 Warning useradd: the home directory already exists. Not copying any file from skel director into it Linux
screenshot 2020 05 05 at 22.42.35 How to run Windows applications on Linux via WineHQ Linux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • ddwwdw
    How to query a list of installed programs in Windows Windows Server
  • dns records
    What are the different types of DNS Records Windows Server
  • Capture 2
    MDT Invalid credentials: The network was not found Windows
  • windows admin center banner 825x400 1
    Fix failed to create new Scheduled Task RemoteException Windows Server
  • youtube cover blue
    How to use the Azure Cloud Shell or Azure CLI and Azure PowerShell AWS/Azure/OpenShift
  • Remote Desktop Connection
    Connect to the Remote Desktop Console from Command Prompt Windows
  • wordpresserrorsiteadmin
    There has been a critical error on this website please check your site admin email inbox for instructions Web Server
  • How to create a Recovery Partition in Microsoft Windows
    How to create a Recovery Partition in Microsoft Windows 10/11 Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,836 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.