Unable to start screen sharing remotely on macOS Catalina after update

remote desktopscreen-sharingterminal

Until one of the latest Catalina updates, I was able to (re)start Screen Sharing using the following command:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent && sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -specifiedUsers && sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users user_name -access -on -privs -ControlObserve

However, after one of the last couple of Catalina updates this fails. To be more specific, if I run the command I don't get any errors, but the Screen Sharing daemon is not launched, so I cannot remotely connect to my Mac. This still works in other Macs running High Sierra, but not in Catalina. Does anybody have any idea what might have changed in the last updates, or how to fix this?

Best Answer

The problem was that, as of Mojave, you cannot stop/start the screen sharing daemon with kickstart unless "Screen sharing" is checked in System Preferences/Sharing. Probably the update just unchecked this preference for some reason, which made it impossible to restart the daemon remotely. Once I had physical access to the computer again and checked this preference everything worked as before the update.