Networking-Forums.com

Professional Discussions => Programming Goodies and Software-Defined Networking => Topic started by: nikolaymartin on May 12, 2020, 09:09:53 AM

Title: Remove A User From the specific Group In Linux
Post by: nikolaymartin on May 12, 2020, 09:09:53 AM
How can I remove a specific user from the group?
Title: Re: Remove A User From the specific Group In Linux
Post by: deanwebb on May 12, 2020, 09:36:48 AM
Well, this is a generic question. Normally, we need more context around the question, but I'll assume it's just a generic security group on a Linux machine, locally defined, and we want to remove a user from that group. OK, with that in mind, I would... um... do a search... and then...

https://unix.stackexchange.com/questions/29570/how-do-i-remove-a-user-from-a-group

# gpasswd -d user group

Cool. Today I learned that gpasswd is for groups. I knew that passwd is for individuals. Thanks for asking the question, linuxbot! :smug:
Title: Re: Remove A User From the specific Group In Linux
Post by: edizgeorgi on May 13, 2020, 08:46:13 AM
It is easier than you think. Use the usermod command with root privileges. Following example will remove the user george from the root group.
$ sudo usermod -G root george

Referance: https://www.networking-forums.com/programming-goodies-and-software-defined-networking/remove-a-user-from-the-specific-group-in-linux
Title: Re: Remove A User From the specific Group In Linux
Post by: deanwebb on May 13, 2020, 11:00:03 AM
Love the new avatars, by the way! :smug:
Title: Re: Remove A User From the specific Group In Linux
Post by: Dieselboy on May 13, 2020, 11:08:39 PM
Fantastic  :smug:
Title: Re: Remove A User From the specific Group In Linux
Post by: deanwebb on May 14, 2020, 12:29:56 PM
I feel much better about things, now that all the cards are on the table. And this is a nice sort of "Linux question of the day" that helps to build my familiarity with the platform.