Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've followed the following guide to setup SSH keys on Mac OS 10.7.4.

https://help.github.com/articles/generating-ssh-keys

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
add comment

2 Answers 2

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
add comment

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 superuser.com/questions/88470/… and serverfault.com/questions/272613/… for caching. –  André Stannek Feb 7 '13 at 17:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.