- 1How to Add a New User in Linux
- 2Modify Existing User in Linux
- 3Delete a User in Linux — Step-by-Step for Beginners
- 4Create a User Group in Linux - Step-by-Step Tutorial
- 5Linux: Add User to Group
- 6How to Remove a User from a Group in Linux
- 7Delete a User Group in Linux - Beginner Friendly Tutorial
- 8Linux su Command Tutorial – Switch Users Easily
- 9Linux sudo Command - Execute as Another User
- 10Change a User's Password in Linux Using passwd
- 11Set Password Expiry in Linux using chage
- 12Lock a User Account in Linux
- 13How to Unlock a User Account in Linux
- 14Configure User Login Shell in Linux
- 15How to Configure User Environment Variables in Linux
- 16Edit .bashrc and .profile in Linux - User Startup Files Tutorial

- 1Linux Topics Index
- 2How to Create a File in Linux
- 3How to Rename a File in Linux
- 4How to Copy a File in Linux
- 5How to Move a File in Linux
- 6How to Delete a File in Linux
- 7How to Create a Directory in Linux
- 8How to Delete a Directory in Linux
- 9How to Copy Directories Recursively in Linux
- 10Delete Directories Recursively in Linux
- 11How to View Hidden Files in Linux
- 12How to Create a Hidden File in Linux
- 13How to Create a Hidden Directory in Linux
- 14How to Find Files in Linux Using find Command
- 15Find Files in Linux Using locate Command
- 16How to View File Contents Using cat in Linux
- 17How to View File Contents Using less in Linux
- 18View File Contents Using the more Command in Linux
- 19Compare Files Using diff Command in Linux
- 20Compare Files in Linux Using cmp Command
- 21Check File Type in Linux with file Command
- 22Create Symbolic Links with ln -s in Linux
- 23How to Archive Files Using tar Command in Linux
- 24Compress Files with gzip in Linux – Beginner Tutorial
- 25How to Compress Files Using bzip2 in Linux
- 26Compress Files in Linux Using zip Command
- 27Extract Compressed Files using tar in Linux
- 28Extract ZIP Files on Linux with unzip
- 29How to Extract .gz Files using gunzip in Linux

- 1How to Add a New User in Linux
- 2Modify Existing User in Linux
- 3Delete a User in Linux — Step-by-Step for Beginners
- 4Create a User Group in Linux - Step-by-Step Tutorial
- 5Linux: Add User to Group
- 6How to Remove a User from a Group in Linux
- 7Delete a User Group in Linux - Beginner Friendly Tutorial
- 8Linux su Command Tutorial – Switch Users Easily
- 9Linux sudo Command - Execute as Another User
- 10Change a User's Password in Linux Using passwd
- 11Set Password Expiry in Linux using chage
- 12Lock a User Account in Linux
- 13How to Unlock a User Account in Linux
- 14Configure User Login Shell in Linux
- 15How to Configure User Environment Variables in Linux
- 16Edit .bashrc and .profile in Linux - User Startup Files Tutorial
How to Remove a User from a Group in Linux
Next Topic ⮕Delete a User Group in Linux - Beginner Friendly Tutorial
How to Remove a User from a Group in Linux
Hey there, and welcome to this beginner-friendly Linux tutorial from ProgramGuru.org!
Today, we're going to learn how to remove a user from a group in Linux. This is a very common task, especially if you're managing users on a multi-user system.
Why would you remove a user from a group?
Groups in Linux help manage permissions. If a user no longer needs access to a specific resource—like a shared folder or service—you should remove them from the group that controls it.
Step 1: Check the groups a user belongs to
Before removing a user from a group, it's a good idea to check what groups they are currently in.
groups username
For example, to check groups for user john
:
groups john
john : john sudo docker developers
This tells us that john
is part of the sudo
, docker
, and developers
groups.
Step 2: Remove user from a group
You can use one of the following commands. Let's go over each.
Option 1: Using gpasswd
This is the cleanest way to remove a user from a group.
sudo gpasswd -d john developers
Removing user john from group developers
Option 2: Using deluser
(Debian/Ubuntu only)
This works similarly but is available only on Debian-based systems:
sudo deluser john developers
Removing user `john` from group `developers` ...
Done.
Option 3: Using usermod
to redefine group membership
This method replaces the user's entire list of supplementary groups, so use it carefully!
sudo usermod -G sudo,docker john
This command reassigns john
to just the sudo
and docker
groups, effectively removing him from developers
.
Step 3: Verify the user was removed from the group
groups john
john : john sudo docker
Great! Now the user is no longer part of the developers
group.
💡 Pro Tip
Group membership changes take effect immediately for new terminal sessions. If the user is currently logged in, they may need to log out and back in to see the changes.
Conclusion
And that’s it! You’ve successfully learned how to remove a user from a group in Linux. Whether you’re managing permissions for a small team or setting up secure environments, this is a key skill to have.
Thanks for watching, and don’t forget to check out more beginner tutorials on ProgramGuru.org!