Force Screen Sharing (or ARD) to always request permission before connecting

New Contributor II

I have been using the Kickstart commands to set various settings when it comes to remote access or SSH on a Mac. Recently I was asked to force Screensharing or ARD to always ask for permission before observing or controlling a Mac.

Now I have gone to the System Preferences > Sharing > Computer Options and I click on Anyone can request access to view this computer and I get the pop up for connecting by requesting permission but it also gives me the option to log in or observe as a Registered user. Can I remove that second option so that it always requests permission to remote into a computer?

Is there a way to do this from command line?



Contributor III

The following command will enable Screen Sharing via Remote Management, and will require the logged in user to grant permission to view the screen. The client initiating the connection would still be given the option to login as a registered user, but would not be able to successfully authenticate.

sudo /System/Library/CoreServices/RemoteManagement/ 
-activate -configure -access -off -setreqperm -reqperm yes -restart -agent

I don't know if there's any way to completely eliminate the authentication option.