How do I change the "primary group" for an existing user?
One way to change your group is through the MacOS System Preferences panel. Open it, and then open the Users &amp; Groups panel. Unlock the lock icon in the bottom-left so that you can enter your password and make changes.

Once the panel is unlocked, you can right-click (or option-click) on the user you want to change and select Advanced Options from the popup-menu. The advanced options panel will let you specify your default group.

To change the primary group from the command line, first get the ID number of the group and then set the primary group id to that value:

Get a list of groups. You may want to pipe this through less.

# dscacheutil -q group


Change user "scott"'s primary id to 20:

# dscl . -create /Users/scott PrimaryGroupID 20


This solution is from Richard York's blog post on dscl
Original link dead Oct 15 - now archived