e Learning

How to Remove Linux User From Group

Command use to remove a user from a group in Linux is gpasswd command. you can remove a user from a certain group using gpasswd with -d or –delete option.

gpasswd -d username groupname

Let’s see with an example

I have a group called administrators in my Linux Server and have Three Members bob, ned and john.

Members of the Administrators Group

Now I want to remove bob from administrators group.

gpasswd -d bob administrators

Now when I list members of The administrators group bob is no longer there.

gpasswd Remove Linux User From Group

You can also use gpasswd command to add regular user add administrative user and also to set Password to a Group in every Linux Distributions including Ubuntu, Centos 7, Fedora and Red Hat Enterprise Linux (RHEL).