Remove A User From the specific Group In Linux

Started by nikolaymartin, May 12, 2020, 09:09:53 AM

Previous topic - Next topic

nikolaymartin

How can I remove a specific user from the group?

deanwebb

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:
Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.

edizgeorgi

#2
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

deanwebb

Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.

Dieselboy


deanwebb

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.
Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.