Remote Desktop on command line

This script allows the user to enable remote desktop on the Mac command line.

#!/bin/bash

# Usage: rdesktop on | off

if [ $# = 1 ] ; then
if [ $1 = 'on' ]; then
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users you -restart
echo "Remote Desktop On"
fi
if [ $1 = 'off' ]; then
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off
echo "Remote Desktop Off"
fi
else
echo " Usage: rdesktop on | off"
fi
Author: Webmaster K

Leave a Reply

Your email address will not be published. Required fields are marked *