Using sudo dscl to create new users with and without admin privileges. The newly created users for some reason are not in the login screen on bootup and using the input entries for users do not login into the account.

Commands I used:

sudo dscl . -create /Users/username

sudo dscl . -create /Users/username UserShell /bin/bash

sudo dscl . -create /Users/username RealName "John Smith"

sudo dscl . -create /Users/username UniqueID 1001

sudo dscl . -create /Users/username PrimaryGroupID 1000

sudo dscl . -create /Users/username NFSHomeDirectory /Local/Users/username

sudo dscl . -passwd /Users/username password

sudo dscl . -append /Groups/admin GroupMembership username

After using the commands the user is created in the users & groups yet they do not appear or are active in the login screen. My filevault is disabled and changing primary groups has not worked. I assumed that it may be because despite the fact that NFSHomeDirectory creates the home directory, the newly created user's home directory isn't created.

I currently have MacOSX El Capitan (10.11.6) and every attempt has failed. I would greatly appreciate some help since I put these commands into a C++ script to automate my user creation.

You must log in to answer this question.

Browse other questions tagged .