If you give a user sudo privileges how can I remove the sudo privileges and make the user become just a regular user?

I used:

sudo adduser username sudo

Now I've changed my mind.

up vote 12 down vote accepted

If you're like me, you are just trying to figure out how to take away sudo access from a user. It's easy, just open sudo, and type the following in. Keep in mind that USERNAME can be replaced by the profile you are doing this to. In terminal type:

sudo deluser USERNAME sudo

This will only take sudo access away from the profile named USERNAME, and will not delete!

Just type

sudo deluser username sudo

This will remove the user named username from the group sudo.

Be careful not to remove the real adminuser from the sudo group.

  • 1
    @abu-bua: Please don’t approve changes that add entirely different solutions to existing answers (a practice commonly called “piggy-back answer”). Those should be posted as separate answers instead. The appropriate rejection reason is: “This edit was intended to address the author of the post and makes no sense as an edit. It should have been written as a comment or an answer.” (emphasis mine) – David Foerster Oct 2 at 18:16

You can also use gpasswd:

sudo gpasswd -d username sudo

This will remove username from group sudo.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.