How to remove user from group?

To remove a user from a group in a Unix-like operating system, you can use the gpasswd or deluser command. Here’s how to do it with both methods:

Using gpasswd:

sudo gpasswd -d username groupname

Using deluser (Debian-based systems):

sudo deluser username groupname

Example:

If you want to remove the user "jack" from the group "sudo", you would run:

sudo gpasswd -d jack sudo

or

sudo deluser jack sudo

After executing the command, the user will be removed from the specified group. If you have any more questions, feel free to ask!

0 Comments

no data
Be the first to share your comment!