Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. #!/bin/bash
  2. # TurnOnSSHAddAdminGroup.sh
  3. #
  4. # Turn on remote login ## Create the com.apple.access_ssh group ## Add the admin group to com.apple.access_ssh ## unload and load the SSH Service
  5.  
  6. sudo systemsetup -setremotelogin on && dseditgroup -o create -q com.apple.access_ssh && dseditgroup -o edit -a admin -t group com.apple.access_ssh && sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist && sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
  7.  
  8. sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers && sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users nameofadmin -activate -access -on -privs -all -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw p@55w0rd -quiet
  9.  
  10. /usr/libexec/PlistBuddy -c ‘Set :com.apple.screensharing:Disabled NO’ /private/var/db/launchd.db/com.apple.launchd/overrides.plist
  11. launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist
  12. for userid in $(ps -Ajc | grep loginwindow | grep -v grep | awk ‘{print $1}’); do
  13. if [ "$userid" = "root" ] ; then
  14. launchctl load /System/Library/LaunchAgents/com.apple.screensharing.agent.plist
  15. else
  16. su “$userid” -c ‘launchctl load /System/Library/LaunchAgents/com.apple.screensharing.agent.plist’
  17. fi
  18. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement