cfgutil no longer works via ssh after upgrading to Sierra I use the cfgutil from Apple Configurator with iOS devices on an OSX host via SSH. After upgrading to Sierra, I get a NSCocoaErrorDomain message and it fails. It works fine at the terminal, however.

Here's my output of trying it successfully at a local terminal, then sshing and the failure:

~ cfgutil list
Type: [...] ECID: [...] UDID: [...] Location: [...] Name: [...]
~  ssh localhost /usr/local/bin/cfgutil list
Password:
cfgutil: error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.configurator.xpc.InternetService" UserInfo={NSDebugDescription=connection to service named com.apple.configurator.xpc.InternetService}


I assume this comes from some increased security measures from Sierra, but for me it's a pain. Any ideas how to disable this or work around it?
I've found a very awkward workaround, though input is hidden:


Create a file, e.g. /tmp/cfgutil.sh on the server
Populate that file with the command you wish to run, e.g. cfgutil list
When you ssh in, run open -a Terminal /tmp/cfgutil.sh


Here's a minimal example:
echo "/usr/local/bin/cfgutil list" &gt; /tmp/cfgutil.sh &amp;&amp; ssh localhost open -a Terminal "/tmp/cfgutil.sh"

I suspect it only works if the user is logged in via the UI as well.