I need to pull from Github all the time and I have a passphrase, but it's a pain, so I typically run...
ssh-agent bash
ssh-add ~/.ssh/id_rsa
<prompt and give passphrase>
And that works for the session, but even after I logout, I would like it to save the passphrase next time I PuTTY in. So I installed keychain, but I'm too dumb to operate it. I tried this...
/usr/bin/keychain ~/.ssh/id_dsa
And it said it added my passphrase, but it didn't work :(
How would I call keychain so it saves my passphrase for Git?
Edit: Apologies for posting this on stackoverflow, it technically does have some relevance to programming as it has to do with Git, but my apologies for not posting it on SuperUser.
You actually need to invoke keychain differently. Add the following to your ~/.bashrc file:
eval `keychain --eval id_rsa`
See the keychain documentation for more information about how to set it up properly for your specific shell or system, or if you have more complex requirements.
Okay this is the best I could come up with...
Install keychain...
Then add the following to ~/.bashrc file:
eval `keychain --eval id_rsa`
THEN add the following to ~/.bash_profile:
ssh-agent bash
That will start keychain. It isn't as simple as just putting both in the bash profile or bashrc file.
You have to keep the keys in a "persistent" state so to say. This can be done by having an agent open one on the local side, combined with — in case of openssh — ssh -A
. Then, ssh-add on the remote server will cause the keys to be opened and retained on the local desktop, such that, when logging in again on the remote side, the keys are already available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With