I am looking for a solution that would automatically load multiple RSA keys at login, some of them having passwords stored in the Keychain.

Example: first keys would be obviously in ~/.ssh/id_rsa and let's say that the second cone would be in ~/.ssh/id_rsa.2.

I want them to be loaded automatically, without having to enter their passwords.

  • What do you mean by loaded? If the keys are password protected you'll have to enter the password at least once. Then you can choose to save the password to Keychain however.
    – Gerry
    Apr 4, 2012 at 7:19
  • So, how to I add the key to the keychain in a persistent mode?
    – sorin
    Apr 4, 2012 at 9:53

1 Answer 1


ssh-agent can do this: use ssh-add -K path/to/key to store the passphrase for the key in your Keychain. Whenever you do something requiring that key you won't be prompted for your password, provided the Keychain is unlocked.

This article gives more information, as does this related ServerFault question.

You must log in to answer this question.

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