I'm doing some remote Mac administration and finding myself needing to copy a keychain to the machine and then add it to the default list of keychains.
Using VNC and the GUI, this is simple: just double-click it and Keychain Access opens, revealing that it's been added. But how do you do this via terminal over SSH, so that it can be scripted? The security
tool doesn't seem to have an "add-keychain" command or an argument to any other command that would do this, as far as I can tell.
How do you do this?
Best Answer
For some reason, the feature is hidden in the form of the
-s
argument tolist-keychains
. The other gotcha is that you need to simultaneously re-add all existing keychains. This should take care of it: