Description
This script will enable the macOS built-in screen sharing for defined users only.
UAMDM
This method no longer works with devices running 10.14+. Please see the following article regarding Screen Sharing on 10.14+
macOS Privacy Preferences Payload in Mojave 10.14+
Attempting to run the below script will yield the following response.
Kickstart Activation Warning
# /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -activate Starting... Warning: macos 10.14 and later only allows control if Screen Sharing is enabled through System Preferences. Activated Remote Management. Done.
After running the command, System Preferences will show Remote Management enabled, but any attempt to connect to a device will show a black screen.
Enabling ssh may be achieved thus:
Enable ssh
launchctl load -w /System/Library/LaunchDaemons/ssh.plist
Ingredients
- FW Admin
- Target macOS client
Directions
- Create a new empty fileset.
- Click the script item in the button bar
- Create a new script
- Open the fileset and rename the script to be unique.
Select the .sh file and choose "edit text" to open the script file.
#!/bin/sh # benm @ filewave # Feb 2013 - original creation #Save output to client log exec 1>>/var/log/fwcld.log exec 2>>/var/log/fwcld.log #enable it sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers # For Change USERNAME to the name of the account you wish to enable. # you must use the short name of the account (the name with no spaces in it) sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users USERNAME -access -on -privs -all sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -activate
Where USERNAME is the short name of a users.
Use Short Name:username
NOT
User Name
Notes
If you add
sudo systemsetup -setremotelogin on
To the script, it will enable ssh login (aka Remote Login).