Friday, March 8, 2013

How can I add an existing user to an existing group via the command line on a Mac OS X machine?

dseditgroup -o edit -u your_admin_username -p -a the_username_of_user_you_want_to_add_to_group -t user the_name_of_the_group_you_want_to_add_user_to
If I wanted to add myself to the "www" group I would simply run the following command:
dseditgroup -o edit -u johnerck -p -a johnerck -t user www
Run the groups command to see that you've been added:
groups

No comments:

Post a Comment

About Me

My photo
I code. I figured I should start a blog that keeps track of the many questions and answers that are asked and answered along the way. The name of my blog is "One Q, One A". The name describes the format. When searching for an answer to a problem, I typically have to visit more than one site to get enough information to solve the issue at hand. I always end up on stackoverflow.com, quora.com, random blogs, etc before the answer is obtained. In my blog, each post will consist of one question and one answer. All the noise encountered along the way will be omitted.