How to Remove User from Group in Ubuntu Linux

laptop gbaa
laptop gbaa

This article describes the steps you can take to remove users from groups in Ubuntu Linux.

Our previous post showed you how to add users to groups in Ubuntu Linux. This post shows you the other way around – removing users from groups in Ubuntu Linux.

A group is a container that can be used to organize or administer user accounts. Accounts in the same group will access and manage resources belonging to that group.

Every account on a Ubuntu Linux system belongs to one or more groups. There are two types of groups: Primary and secondary groups.

Below is a post on how to add users to groups in Ubuntu Linux.

How to add a user to a group in Ubuntu Linux

Removing users from a group in Ubuntu Linux

As stated above, groups help administrators efficiently organize or administer user accounts’ access to resources. With grouping, you can provide access to a resource, and all group members will access it.

You can use the steps below to remove the account if a user is no longer needed in a group.

The format to remove a user from a group is as follows:

sudo deluser username groupname

The deluser command is a script that uses the usermod command to add or remove users from groups.

For example, you remove the user named geekrewind from the developers‘ group; you run the commands below.

sudo deluser geekrewind developers

A user account must be a member of one primary group – typically a group with a similar name to the user. You can change the primary group of a user account.

For example, you use the commands below to change the primary group of the user geekrewind to developers.

sudo usermod -g developers geekrewind

Doing that will remove the geekrewind user from its primary group to a new developers group as its primary group.

You can then remove the account from its previous primary group.

To verify a user group, run the command format below.

groups username

That should do it!


This post showed you how to remove users from groups in Ubuntu Linux. Please use the comment form below if you find any errors above or have something to add.

Posted by
Richard W

I love computers; maybe way too much. What I learned I try to share at

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: