Skip to content

Instantly share code, notes, and snippets.

@mikezter
Created April 5, 2013 09:08
Show Gist options
  • Save mikezter/5317838 to your computer and use it in GitHub Desktop.
Save mikezter/5317838 to your computer and use it in GitHub Desktop.
# This script will add a user "devteam" with password "devteam" and allow him to # view your screen.
#!/bin/bash
#
# This script will add a user "devteam" with password "devteam" and allow him to
# view your screen.
dscl . -delete /Users/devteam &> /dev/null
maxid=$(dscl . -list /Users UniqueID | awk '{print $2}' | sort -ug | tail -1)
newid=$((maxid+1))
dscl . -create /Users/devteam
dscl . -create /Users/devteam UniqueID "$newid"
dscl . -create /Users/devteam UserShell /bin/bash
dscl . -passwd /Users/devteam devteam
dscl . -append /Groups/com.apple.access_screensharing GroupMembership devteam
defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false
launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment