To add a user to the sudo group, follow these steps:
-
Open a Terminal.
-
Run the usermod Command: Use the following command, replacing
usernamewith 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.
-
Verify the Change: You can check if the user has been added to the
sudogroup by running:groups usernameYou should see
sudolisted 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
