Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I have a Mac OSX server running Snow Leapord. I only have ssh access, and I have root access. I want to add a new user. I'm a long time unix user and was a bit suprised to see adduser and useradd not available. A bit of digging (e.g. this SO question) shows that it's not as straight forward.

I've tried things I've read, such as nitool ("command not found"), and dscl / -create ... ("Data Source (/) not valid"). So how the hell do I create a new user user on the command line in OSX?!

share|improve this question
This is pretty much a duplicate of…. – Gordon Davisson Mar 5 '10 at 21:34
Ah yes that other question is exactly what I'm looking for. However it didn't come up as a suggested question when I was searching. Bug in the search, perhaps? – Rory Mar 6 '10 at 14:34

This manual gives information on using dscl. Also see this.

Here is some older information on niutil.

share|improve this answer
I found that page from osxdaily, but it doesn't work. – Rory Mar 5 '10 at 11:28
dscl does work - it's the standard command line way of creating users with OSX - what exactly is your error? – Jon Rhoades Mar 5 '10 at 11:57
The error I'm getting is in the question, "Data Source (/) not valid" – Rory Mar 5 '10 at 15:28
Try localhost instead. – Dennis Williamson Mar 5 '10 at 16:13
The command I ended up using is "sudo dscl . -create /Users/<user_name>". Use . instead of /. – CadentOrange Jul 16 '12 at 7:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.