Manually add users under MacOS X Leopard

by Wolfram Saringer  (2009-04-27)
last change: 2009-04-27


Unfortunately not as easy as editing /etc/passwd...

Adapted from a blog entry athttp://tagebuch.localwurst.de/2008/07/08/usergroups-anlegen-macos-x-leopard/

$ sudo dscl .
Password:
> cd Groups
/Groups > list . PrimaryGroupID ##list currently configured groups with IDs
/Groups > create _test ## create new group '_test'
/Groups > append _test RecordName test ## create alias 'test' for group _test
/Groups > create _test PrimaryGroupID 1111 ## set ID to 1111 for group _test
/Groups > create _test RealName "test group" ## add some descriptive text
/Groups > cd ../Users ## change to user list
/Users > list . UniqueID ## list currently configured users
/Users > create _test ## create user _test
/Users > append _test RecordName test ## create an alias
/Users > create _test RealName "test user" ## add descriptive text
/Users > create _test UniqueID 1111 ## add user ID
/Users > create _test PrimaryGroupID 1111 ## set primary group id
/Users > create _test UserShell /bin/bash ## shell
/Users > append /Groups/_test GroupMembership _www ## add another (existing) user to the new group
/Users > quit

all articles represent the sole opinion of their respective author. all content comes without any warranty for correctnes, despite due diligence.