Skip to content

Instantly share code, notes, and snippets.

@mebubo
Created February 25, 2014 17:25
Show Gist options
  • Select an option

  • Save mebubo/9213597 to your computer and use it in GitHub Desktop.

Select an option

Save mebubo/9213597 to your computer and use it in GitHub Desktop.
#!/bin/sh
USERNAME=$1
. /etc/rc.common
dscl . create /Users/$USERNAME
dscl . create /Users/$USERNAME RealName "$USERNAME Account"
dscl . create /Users/$USERNAME hint "Password Hint"
dscl . passwd /Users/$USERNAME thisistheaccountpassword
dscl . create /Users/$USERNAME UniqueID 546
dscl . create /Users/$USERNAME PrimaryGroupID 80
dscl . create /Users/$USERNAME UserShell /bin/bash
dscl . create /Users/$USERNAME NFSHomeDirectory /Users/$USERNAME
cp -R /System/Library/User\ Template/English.lproj /Users/$USERNAME
chown -R $USERNAME:staff /Users/$USERNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment