Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question

closed as off topic by Wesley, mdpc, Dave M, Khaled, petrus Apr 1 '13 at 19:48

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Could you please copy into your question the exact error message you get? –  Jenny D Mar 30 '13 at 14:17
    
@JennyD I get su: unknown login: git –  Newben Mar 30 '13 at 14:25
    
@JennyD, I added this line dscl . -create /Users/git PrimaryGroupID 80, then it worked. But I still doesn't see the '$newuser' under the /Users folder –  Newben Mar 30 '13 at 14:53

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

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