Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

Use usermod(1M):

# usermod -g PRIMARY_GROUP -G SECONDARY_GROUP username
share|improve this answer

Have you tried the newgrp command?

share|improve this answer
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 '12 at 8:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.