title: macOS - Jenkins - ssh - xccode - Execution policy exception registration failed and was skipped: Error Domain=NSPOSIXErrorDomain
body: <p><strong>Symtom Description</strong></p>
  
  <p>When SSH'ed into a mac running 10.15.1 (Catalina) (or connected via Jenkins using a node that connects via ssh), if I try to build my xcode project (building an iOS mobile app), the codesigning phase fails with the error:</p>
  
  <p><code>Execution policy exception registration failed and was skipped: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" (in target 'myproj' from project 'myproj')</code></p>
  
  <p>in several places (always around when I am calling codesign)</p>
  
  <p><strong>What I have tried</strong></p>
  
  <p>Originally the issue I was having was that I was receiving an "errSecInternalComponent" and the build was failing. </p>
  
  <p>I tried adding calls to explicitly unlock the login keychain (security unlock-keychain) where my signing certs were located and that helped that issue, but the Operation not permitted message persisted. </p>
  
  <p>I confirmed that building directly from the command line on the mac itself in a terminal window works just fine. This problem is exclusive to connections via ssh</p>
  
  <p>I updated System Preferences --> Privacy &amp; Settings --> Developer Tools to include allowing every program I could think of that might be related (including all xcode tools, codesign, java, and several others I thought could be related to anything Jenkins might try to do), but this alone didn't make a difference</p>
  
  <p>I tried creating a new mac node in Jenkins that connected via JNLP instead to see if that helped, but got the same result.</p>
  
  <p>I disabled csrutil from the OS Recovery partition but this did not help.</p>
  
  <p>I moved my certs to the System keychain to see if that helped. It didn't.</p>
  
  <p>This build runs fine on the older mac mini (pre-T2 security chip), but this new machine is a newer mac-mini with the T2 chip. Just to rule out everything, I even dropped the security level on safe boot, but that had no impact. </p>
  
  <p>The older machine is also not running Catalina. </p>
  
  <p>Anyone else ever hit this? And if so, did you figure it out? </p>