Knowledge Base : Create a new user in MacOSX (via CLI)

To create a new Open Directory and MacOSX user on the Unix shell:

1. Create OD user:

root# dscl -u diradmin /LDAPv3/ -create /Users/hans RealName “Hans Wurst”
root# dscl -u diradmin /LDAPv3/ -create /Users/hans UserShell /bin/bash
root# dscl -u diradmin /LDAPv3/ -create /Users/hans NFSHomeDirectory /Network/Servers/
root# dscl -u diradmin /LDAPv3/ -passwd /Users/hans secret

2. create MaxOSX home directory:

root# createhomedir -u hans
creating home directories for (
created (/Network/Servers/

3. List OD Users:

root# dscl /LDAPv3/ -list /Users

4. Get all entities for a user:

root# dscl /LDAPv3/ -read /Users/hans

root# finger hans

Login: hans Name: Hans Wurst
Directory: /Network/Servers/ Shell: /bin/bash
Never logged in.
No Mail.
No Plan.