title: How To add-trusted-cert on a Mac Remotely (without user interaction)
body: <p>Is it possible to add a trusted certificate on a Mac OS X 10.8.3 remotely? If so, how? </p>
  
  <p>My current approach is to use the command below. Can it be tweaked so that it works remotely without user interaction?</p>
  
  <pre><code>security add-trusted-cert foo.cer
  </code></pre>
  
  <p>When I try the command above, I get <code>SecTrustSettingsSetTrustSettings: The authorization was denied since no user interaction was possible.</code></p>
  
  <p>My situation: the tool I'm using executes <code>/bin/sh -xe bar.sh</code> on the target machine and I have control over [1] which user it executes as and [2] the contents of <code>bar.sh</code> which currently has <code>security add-trusted-cert foo.cer</code>. Unlocking the keychain first does not appear to be the answer.</p>