1

OS X has a command line tool called security that is made for working with keychains. The man page has examples of how to export all items of a specific type / all items for a specific keychain - but I don't understand how to export / import a single item.

What I would really like to do is update the password on a single IPSec XAuth Password item but I think maybe exporting, possibly deleting, then importing would be the closest thing to what I want.

I haven't had any luck finding examples or related questions for this task, and I've not used the security tool other than to list available keychains.

1 Answer 1

0

You can use find-generic-password or find-internet-password:

security find-generic-password -l 'keychain item name'
security find-internet-password -s accounts.google.com

-l mathes a label and -s matches a server string. Add -w to only print the password.

2
  • you are awesome! is there any way to change the stored value (i.e. save it back into the keychain?)
    – cwd
    Nov 22, 2013 at 23:52
  • did you find an answer to importing it back in? Jul 28, 2016 at 0:17

You must log in to answer this question.

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