Is it possible to copy a certificate to a machine running OS X Snow Leopard, add it to the System Keychain, then set it to "Always Trust via SSH?"

And if so... how?


To import a trusted certificate use the terminal command

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain <certificate>

This will add a trusted certificate to the System.keychain. You should modify the options and paths to suit your situation. See the man page for security for more information.

↬ Rich Trouton, Adding new trusted root certificates to System.keychain

  • The quotes messed me up for some reason, removed them and all was well. – counterbeing Apr 17 '14 at 0:02
  • @jaberg, and how to add certificate via ssh to local keychain, not system? – gaussblurinc Sep 9 '14 at 12:30
  • 6
    Thanks muchly! Just a note: One can also add to "$HOME/Library/Keychains/login.keychain" – user110537 Jan 21 '15 at 13:48
  • 3
    What is the difference between security add-trusted-cert and security import? – Nepoxx Oct 10 '19 at 15:14
  • link is broken, : unix.com/man-page/mojave/1/security – anki Mar 5 '20 at 19:23

You must log in to answer this question.