1

How to change primary user group of a user? Preferably without losing the current primary group altogether as the user is part of 'staff' ie. admin. I suppose I could create another admin user and then recreate the original user, but is there a simpler way?

2 Answers 2

4

Use usermod(1M):

# usermod -g PRIMARY_GROUP -G SECONDARY_GROUP username
1

Have you tried the newgrp command?

1
  • newgrp changes the group for just the current login session, usermod as suggested by @gtirloni changes the default groups defined in the passwd and group files for all future logins.
    – alanc
    Sep 2, 2012 at 8:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .