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've followed the following guide to setup SSH keys on Mac OS 10.7.4.

But for some reason it continually prompts me for my passphrase. It doesn't prompt me if I don't specify a passphrase, but that isn't desired. Is there a way to cache my passphrase so that I won't be prompted for every pull/push?

share|improve this question
seems like you gave a passphrase when creating the SSH keys – Sathya Feb 7 '13 at 17:26
I did, is there a way to cache it or anything? – Phillip Whisenhunt Feb 7 '13 at 17:27
up vote 4 down vote accepted

From this article

Storing Passphrases in the Keychain

To store the passphrase for your default key in the Keychain open a Terminal and run:

ssh-add -K

And to store the passphrase for a different key run:

ssh-add -K /path/to/private/key/file

When prompted for your passphrase enter it and that is it.

You will never need to run ssh-add nor enter your passphrase again.

share|improve this answer
I've tried that bu I get Could not open a connection to your authentication agent. – Phillip Whisenhunt Feb 7 '13 at 17:51
You may have to reboot, or at least log out and in. From the most up-voted answer here, it would appear the loading of keychain keys to ssh-agent happens at login. – Ryan Feb 7 '13 at 17:57
A restart fixed it! Thank you! – Phillip Whisenhunt Feb 7 '13 at 18:03

If you create a key pair with a passphrase you have to enter that passphrase to unlock your private key. If you don't enter the correct passphrase your private key will not match the public key stored at github and the authentication cannot be performed.

If you don't want a key without a passphrase you have no way around entering the passphrase every time the key is used.

Having a key without passphrase is only a security issue if someone else gets their hands on your private key.

share|improve this answer
Your comment appeared after I posted my answer. I don't know much about Mac but check out… and… for caching. – André Stannek Feb 7 '13 at 17:46

You must log in to answer this question.

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