productsign error: SignData failed: CSSMERR_CSP_NO_USER_INTERACTION

code-signing, macos, packagemaker

Solution

I solved it by accident - after combing the web for hours - while reproducing the steps when filing an incident report with Apple Support.

From the Mac (as opposed to from an ssh session) the same command generated a popup asking for permission to access the Keychain.

After choosing "Always Allow" the problem went away. Forever.

Problem

When signing an app from an ssh terminal session, I am getting the following error: ``` productsign[29321:707] SignData failed: CSSMERR_CSP_NO_USER_INTERACTION (-2147415840) ``` productsign was working until recently. How do I get around this error?

Original source