Search code examples
macossshkeychain

OSX security find-identity can't find identities in ssh-ed machine


I am ssh-ing into otherosx OSX (10.10.3) machine from my OSX(10.10.3) machine in order to build a mac application.

ssh user@otherosx

Then on otherosx I try to import identities like this:

security default-keychain -s /path/to/my/login.keychain
security unlock-keychain 
security import my_identity.p12 -P passphrase

Then I try to find my identity:

security find-identity

and I get this:

Policy: X.509 Basic
  Matching identities
   0 identities found

  Valid identities only
   0 valid identities found

Does anyone know how to fix this? Did anyone experience the same issue?

PS. I also tried full paths everywhere, and security list-keychains -s /path/to/my/login.keychain before unlocking keychain and searching for identities.


Solution

  • OK, it seems that if you import like this:

    security import my_identity.p12 -k /path/to/my/login.keychain -P passphrase
    

    then it works. At least worked once for me.

    It seems this might also be related to these questions:

    "User interaction is not allowed" trying to sign an OSX app using codesign

    Xcode, Codesign Error from Jenkins / SSH - "User Interaction is not allowed"