Server Fault is a question and answer site for system and network administrators. 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 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>
git pull

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. So now when I login, I type...

ssh-agent bash (Which I'm guessing causes bashrc to load and then keychain loads)
git pull

How would I make it so I don't need to call "ssh-agent bash" every time I login?

I'm using ArchLinux...

share|improve this question
Which platform are you doing this on? What is 'keychain'? Is it OS X's Keychain? – Martijn Heemels May 16 '12 at 21:29
This howto describes what you're trying to do:… – Martijn Heemels May 16 '12 at 21:35

Use Putty's ssh agent - Pageant for your private keys and enable agent forwarding.

share|improve this answer
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer


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.