Adding the User to Sudo group

To add a user to the sudo group in Linux, you can use the usermod command. The sudo group grants users administrative privileges. Here's how you can add a user to the sudo group:

  1. Open a terminal.

  2. Execute the following command as a user with administrative privileges (or as the root user):

    usermod -aG sudo username

    Replace "username" with the actual username of the user you want to add to the sudo group.

  3. After running the command, the user will be added to the sudo group. The changes will take effect upon the user's next login.

  4. Optionally, you can verify the user's group membership by executing the following command:

    id username

    It will display the user's group information, including the sudo group.

Make sure to replace "username" with the actual username of the user you want to add to the sudo group.

Last updated