[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

how to remove the user from group using userod command?

how to remove the user from group using userod command?  in linux?
0
mokkan
Asked:
mokkan
2 Solutions
 
farzanjCommented:
It is usermod

You have to name all the groups except for the one you want to remove

usermod -G g1,g2,g3 userid
0
 
upanwarCommented:
Farzani is correct but if you want to remove a user from its initial/primary group then you have to change its primary group.

# usermod -g <new group>

Could you please paste the output of below given command and update from which group you want to remove the user then we can help you accordingly.

# groups userid or username
0
 
mokkanAuthor Commented:
thank  you.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now