Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to export some items on my keychain like this:

hostname:~ username$ security export -k login.keychain -t all -P "passphrase"

but I always get this error:

security: SecKeychainItemExport: Passphrase is required for import/export

What gives?

clarification: I'm logged in via SSH.

share|improve this question

This is just broken, IMO. 'security export' behaves very badly if you try to export private keys and you log in with SSH. Same commands work when you log in from the GUI. Is this on purpose?

Depending on what you need, you might be able to work around it with 'security find-certificates' or 'security export -t certs'. It all works as long as you don't export a private key.

share|improve this answer

If your passphrase has any odd symbols your shell is swallowing, try using single quotes instead of double to prevent interpolation.

security export -k login.keychain -t all -P 'passphrase'
share|improve this answer
I think this is not a quotation issue. – Charles Stewart Oct 5 '11 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .