Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # TurnOnSSHAddAdminGroup.sh
- #
- # 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
- 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
- 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
- /usr/libexec/PlistBuddy -c ‘Set :com.apple.screensharing:Disabled NO’ /private/var/db/launchd.db/com.apple.launchd/overrides.plist
- launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist
- for userid in $(ps -Ajc | grep loginwindow | grep -v grep | awk ‘{print $1}’); do
- if [ "$userid" = "root" ] ; then
- launchctl load /System/Library/LaunchAgents/com.apple.screensharing.agent.plist
- else
- su “$userid” -c ‘launchctl load /System/Library/LaunchAgents/com.apple.screensharing.agent.plist’
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement