Skip to content

Instantly share code, notes, and snippets.

@svanzoest
Created October 19, 2017 00:07
Show Gist options
  • Save svanzoest/395701a853b41513ae9f5801f48e7805 to your computer and use it in GitHub Desktop.
Save svanzoest/395701a853b41513ae9f5801f48e7805 to your computer and use it in GitHub Desktop.
Create MacOS User
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "Sorry, you are not root."
exit 1
fi
sysadminctl \
-addUser ${USERNAME} \
-fullName "${FULLNAME}" \
-UID ${UID} \
-shell /bin/bash \
-password ${PASSWORD} \
-home /Users/${USERNAME}
createhomedir -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment