Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Scenario 1. I am doing this from /home/deploy directory

I am trying to set up ssh with github for capistrano deployment. this has been an absolute nightmare.

when I do ssh git@github.com as the deploy account I get

Permission denied (publickey).

so may be the key is not being found, so If I do a

ssh-add /home/deploy/.ssh/id_rsa

Could not open a connection to your authentication agent.

(i did verify that the ssh-agent was running) If I do exec ssh-agent bash and then repeat the ssh-add then the key does get added and I can ssh into github.

Now I exit from the ssh connection to my server and ssh back in and I can't ssh into github anymore!

Scenario 2

if I login to my remote server and then cd into my .ssh directory and ssh into github then it all works fine

I guess there is a problem with locating the key and for some reason the agent isn't funcitoning correctly.

Any ideas?

Her is a pastie with more details..my .bashrc, permissions etc.

http://pastie.org/pastes/1190557/

share|improve this question

2 Answers 2

Is it possible that you are by default trying to add to the system's ssh-agent and you don't have permission? or it just isn't be launched at all? Github has a page on having ssh-agent launch on login, did you give this a look? http://help.github.com/working-with-key-passphrases/

share|improve this answer
    
yes i did look at it and added that to my .bashrc file. no luck. Here is some more info on my .ssh folder and the output of ssh -v git@github.com pastie.org/1190557 –  user55714 Sep 30 '10 at 4:27

Try removing line 5 'IdenityFile' in your local config.

Reasoning. By defualt ssh should be looking for id_rsa as your private key. But they why you are defining it is wrong. You either need the full path or at least ~/.ssh/id_rsa. But like I said before, you probably don't need it.

The other reason, in your verbose loggin I see these two lines

debug2: key: id_rsa ((nil))
...
debug1: Trying private key: id_rsa
debug2: we did not send a packet, disable method

Which is telling me that it's using the key id_rsa (which you defined) but it's empty or can't find it.

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.