

Next, use the “deluser” command to remove the user from the sudo group as follows: sudo deluser testuser sudo Remove New User From Sudo GroupĪs you can see in the previous screenshot, the new user was removed from the sudo group. What if you need to delete the granted administrative privilege from a user? Do not worry this easy you will just need to logout from the new user as follows: exit Logout sudo mkdir newdir Create New Directory Using SudoĬongratulations, you are now in the sudo group and can execute any command as an administrator. Now, let’s create a new directory using the sudo command. su - testuser Login Using Newly Created UserĪs you can notice, you will get a message telling that to run a command as an administrator, and you can use the sudo command. Now you can log in to the newly created user and start using the sudo command. To make sure that the newly created user was added to the sudo group, you can use the following command: sudo -l -U testuser New User Added To Sudo GroupĪs you can notice, the output of the previous command will tell you the new user was added successfully to the sudo group. Adding a User To The Sudo GroupĪfter creating the new user, you can now add this user to the sudo group using the next command: sudo usermod -a -G sudo testuser Add User To Sudo Group


Moreover, you need to add some additional information, or just you can leave them blank. Now, you will be asked to enter the new user password. To use the “adduser” command, you need to be a root user, or you can use the sudo command to create a new user.
