This tutorial helped you to create a new user with Sudo privileges, add an existing user to sudo privileges or remove sudo privileges from any account.

Create User with Sudo Access

Use the system’s default “adduser” command to create a new account. As per current requirements the command syntax will be like: Here:

USER_NAME is the name of the new user account. GROUP_NAME Define a group name here to automatically add user to this group during creation.

Let’s try with a real example. The following command will create a new user tecadmin and add it to sudo group. In case of user already exist, it will simply add the user to the sudo group.

Add Existing User to Sudo

You can also use the following command to add existing users to group sudo, where it will get full sudo privileges. This will just add tecadmin user to the sudo group. One can verify the same in the /etc/group file.

Remove Sudo Privileges from User

The following command will remove a user from the sudo group. This will just remove the tecadmin user from the sudo group. It will not remove the user from the system. We also recommend viewing the /etc/sources file and remove any user-specific entry.

Conclusion

This tutorial helped you to provide special permission to users using Sudo on a Debian system. Additionally, this tutorial provides you with permission to allow sudo access to the existing accounts. Also, remove Sudo privileges from the user.