FG

How to add user to a group from Mac OS X command line?

Fresh3 days ago
Mar 15, 2026310954 views
Confidence Score1%
1%

Problem

I am trying to add a user to a group from the command line but can't figure out how. Specifically this is on Mac OS X Server version 10.5.8. The user is 'john', the groups are 'admin' and 'wheel'.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to add user to a group from Mac OS X command line?

Low Risk

It's also possible to do this with , but to do it properly you need to both add the user's short name to the group's list, and add the user's GeneratedUID to the group's list. takes care of both in a single operation.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment