How to add user to sudo group?

To add a user to the sudo group, follow these steps:

  1. Open a Terminal.

  2. Run the usermod Command: Use the following command, replacing username with the actual username of the user you want to add:

    sudo usermod -aG sudo username
    • -aG: This option appends the user to the specified group without removing them from other groups.
    • sudo: This is the group you are adding the user to.
  3. Verify the Change: You can check if the user has been added to the sudo group by running:

    groups username

    You should see sudo listed among the groups for that user.

Example

To add a user named joker to the sudo group, you would run:

sudo usermod -aG sudo joker

After that, verify with:

groups joker

0 Comments

no data
Be the first to share your comment!