I'm connecting to a SSH server with a key file that has a passphrase. How can I make ssh stop asking for passphrase and always use the correct passphrase?

link|improve this question
feedback

3 Answers

up vote 5 down vote accepted

Obviously you have to provide the correct passphrase at least once.

take a look at keychain for "storing" the passphrase bound to the private key. Keychain uses the ssh-agent for accessing the keys.

I use this line in my shell startup script:

eval `keychain --eval --nogui -Q -q .ssh/id_rsakey`

Therefore I have to provide the passphrase once the shell starts, and it is stored for the whole login process. ssh-agent should be running, of course, in my case it is started via .xinitrc

link|improve this answer
feedback

You can use ssh-agent to remember the passphrase for you. There's a nice guide on how to do this up on github:

http://help.github.com/ssh-key-passphrases

link|improve this answer
feedback

The key is stored in a "locked" state, and is unlocked by your passphrase every time you want to use it. You can create a key without a passphrase (not recommended), or most operating systems allow you to unlock the key for a certain period of time, or even from login.

Which OS are you using?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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