-2

I am a mac user I created a user from the terminal using dscl (I am more familiar to linux and adduser command)

It seemed to work but I can't find my newly created user under /Users, and the command sudo su $newuser is not recognized by the terminal. (but when I go to my mac preferences, I can see the $newuser created). How can it be ?

epsilones
  • 97
  • 1
  • 3

1 Answers1

2

dscl doesn't create a home directory. The part -create /Users/git just mean to create an entry in the /Users section of the LDAP tree that manages MacOS users, this is isn't a file system path. You have to add informations about where the home directory is in the first place with additional dscl commands and then create this home directory manually with mkdir. Also, see this answer.

Sven
  • 98,649
  • 14
  • 180
  • 226