问题
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.
回答1:
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"
回答2:
Run the command "security list-keychain" remotely and check if it is listing your keychain. I my case it wasn't. So I fixed it upgrading my OSX to the last version. I read about some problems with the Sierra version of the OSX.
来源:https://stackoverflow.com/questions/29914718/osx-security-find-identity-cant-find-identities-in-ssh-ed-machine