Created
January 2, 2014 04:53
-
-
Save juliandunn/8215219 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "First password prompt is for sudo" | |
# create the user | |
sudo dscl localhost -create /Local/Default/Users/amanda | |
sudo dscl localhost -create /Local/Default/Users/amanda RecordName amanda | |
sudo dscl localhost -create /Local/Default/Users/amanda UserShell /bin/bash | |
sudo dscl localhost -create /Local/Default/Users/amanda RealName "Amanda backup user" | |
sudo dscl localhost -create /Local/Default/Users/amanda UniqueID 5000 | |
sudo dscl localhost -create /Local/Default/Users/amanda PrimaryGroupID 0 | |
sudo dscl localhost -append /Local/Default/Groups/admin GroupMembership amanda | |
sudo dscl localhost -create /Local/Default/Users/amanda NFSHomeDirectory /Users/amanda | |
echo "Next passwords are for passwd" | |
sudo passwd amanda | |
# create the users home directory | |
sudo ditto -rsrcFork '/System/Library/User Template/English.lproj/' /Users/amanda | |
sudo chown -R amanda:wheel /Users/amanda | |
# set up the .amandahosts file | |
sudo sh -c "echo 'indexserver.your.domain indexserveramandauser' > /Users/amanda/.amandahosts" | |
sudo chown amanda:wheel /Users/amanda/.amandahosts | |
sudo chmod 600 /Users/amanda/.amandahosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment