Super User is a question and answer site for computer enthusiasts and power users. 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

Can anyone tell me how to modify a user and add them to a group in terminal on SL (10.6.1)?

It seems that usermod is not used by Mac.

share|improve this question
up vote 7 down vote accepted

dscl is the usual way to modify any stuff from Directory Services (whether local or remote) from the command line. See the dscl manpage for all the info (or the local one if you are not running 10.6). Google turns up many examples of how to use it (including many from

share|improve this answer

Adding a user:

dscl . append /Groups/admin GroupMembership usershortname

Removing a user: (from the group not the system)

dscl . delete /Groups/admin GroupMembership usershortname

Reading the membership of the admin group:

dscl . read /Groups/admin GroupMembership
share|improve this answer

You're correct, these commands are not included in OSX. Although there is a port of adduser for Mac, so you can add a user and change their groups from the command line. Command info here.

share|improve this answer
I am looking more so for the modifying a user and adding them to a specific group – ricbax Oct 25 '09 at 1:12
this tool can do both. – John T Oct 25 '09 at 2:06

To add an example, this is how you can modify someones homedirectory:

dscl . -create /Users/postgres NFSHomeDirectory /opt/local/var/db/postgresql84

You can see also properties for an object using the read command:

dscl . -read /Users/postgres
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .