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?!

  • 1
    This is pretty much a duplicate of serverfault.com/questions/20702/…. Mar 5, 2010 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? Mar 6, 2010 at 14:34

1 Answer 1


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

Here is some older information on niutil.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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