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 10.5.8
like to add user to 'admin' and 'wheel' groups
Answer
sudo dseditgroup -o edit -a $username_to_add -t user admin
sudo dseditgroup -o edit -a $username_to_add -t user wheel
It's also possible to do this with dscl
, but to do it properly you need to both add the user's short name to the group's GroupMembership
list, and add the user's GeneratedUID to the group's GroupMembers
list. dseditgroup
takes care of both in a single operation.
No comments:
Post a Comment