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 have github. I created a private/public pair. I put the public on github.

But I can never push to github. Every time, it says public denied. In order to push, I need to do this:

eval ssh-agent
ssh-add ~/.ssh/github_dsa

This is driving me nuts that I have to do this every time. So, I just put it in my ~/.bashrc file. I feel like that's a hack. Is this normal?

share|improve this question
    
What are you using as your windows manager on Linux? There are several distros that have scripts and apps place that starts a ssh-agent when your X11 session starts, and then unlocks your key when you login. –  Zoredache Jan 28 '11 at 8:34

1 Answer 1

up vote 3 down vote accepted

For a non-default-named SSH key? Sort of. SSH is going to look for id_dsa and id_rsa, and not github_dsa by default. using an SSH agent to hold the key as one to check is one option, the other option would be an IdentityFile line in your ~/.ssh/config, for example:

IdentityFile ~/.ssh/github_dsa

usually you would want to specify that line just for hostnames used by github, since adding it globally means that key will be tried against any host you SSH to.

if you don't want to manually add the SSH key each time, you might consider setting up a session-wide SSH agent, for example, seahorse to start at login.

share|improve this answer

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.