How to remove a user from a group?

You can remove a user from a group using the gpasswd command or the deluser command (on some systems). Here’s how to do it with both methods:

  1. Using gpasswd:
sudo gpasswd -d username groupname

Replace username with the actual username and groupname with the name of the group you want to remove the user from.

  1. Using deluser (Debian-based systems):
sudo deluser username groupname

Again, replace username with the actual username and groupname with the name of the group.

For example, to remove a user named john from a group named developers, you would run:

sudo gpasswd -d john developers

or

sudo deluser john developers

0 Comments

no data
Be the first to share your comment!