Skip to content
Follow
Ubuntu Linux

How to Remove Users from Groups in Ubuntu

Richard
Written by
Richard
Jan 3, 2023 Updated Jul 14, 2026 2 min read
How to Use Sticky Notes in Windows 11
How to Use Sticky Notes in Windows 11

Removing users from groups in Ubuntu lets you take away their special permissions. A group in Ubuntu acts like a shared permission club for user accounts, deciding who can access certain files or features.

You can easily manage these permissions using commands in the Ubuntu terminal, the text-based window where you type instructions. For example, Ubuntu 22.04 LTS uses this system to control access.

Taking a user out of a group removes their access to things that group controlled. This is important for keeping your system secure and organized, especially when a user no longer needs certain privileges.

⚡ Quick Answer

You remove users from groups in Ubuntu using the command line. Type `sudo deluser username groupname` to remove a specific user from a group. You can verify group membership by running `groups username`.

Removing users from a group in Ubuntu Linux

Removing users from groups in Ubuntu Linux is quite straightforward with a single command.

A user can be removed from an Ubuntu group when they no longer require access to shared files or permissions. Removing a user from the ‘sudo’ group, for instance, revokes their administrator privileges.

The command format to remove a user from a group looks like this:

🐧Bash / Shell
sudo deluser username groupname

The deluser command itself is a script that leverages the usermod command to manage user group memberships.

To remove a user from a group in Ubuntu, you execute a specific command in the terminal. For example, to remove the user named `geekrewind` from the `developers` group, you would run the command `sudo gpasswd -d geekrewind developers`. This command targets the specific user and group, ensuring accurate removal without requiring deep knowledge of other system settings.

🐧Bash / Shell
sudo deluser geekrewind developers

A user account must always belong to at least one primary group. This is typically a group named after the user. You can change a user’s primary group if needed.

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

🐧Bash / Shell
sudo usermod -g developers geekrewind

This action moves the geekrewind user from its current primary group to the developers group.

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

💡Tip
To check which groups a user belongs to, use the command below:
💻Code
groups username

This process is complete.

Conclusion:

  • Groups in Ubuntu Linux help administrators efficiently organize or administer user accounts’ access to resources
  • The format to remove a user from a group is “sudo deluser username groupname”
  • The deluser command uses the usermod command to add or remove users from groups
  • It’s important to note that a user account must be a member of one primary group
  • You can change the primary group of a user account using the usermod command
  • Verifying a user group can be done by running the “groups username” command

How do I remove a user from the group?

Once you’ve identified the user to remove from the group, click on their entry. Then, select ‘Remove from group’ to confirm.

How to remove multiple users together from a group in Linux?

Removing multiple users from a group in Linux can be done efficiently, even though some commands only allow you to remove one user at a time.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Add Users to Groups in Ubuntu Linux
Ubuntu Linux How to Add Users to Groups in Ubuntu Linux
How to Create a Headless VM on Ubuntu Using VirtualBox
Ubuntu Linux How to Create a Headless VM on Ubuntu Using VirtualBox

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *