Heroku: Permission denied (publickey). fatal: Could not read from remote repository.

Posted on 18-10-2013 13:58 by graham
The way I solved this issue was the following:

1. Ran ssh-agent with the following command:
ssh-agent

and got output:
SSH_AUTH_SOCK=/tmp/ssh-QihvHx3336/agent.3336; export SSH_AUTH_SOCK;
SSH_AGENT_PID=6380; export SSH_AGENT_PID;
echo Agent pid 6380;

I figured the ssh-agend was trying to export environment variables in Linux style, so I manually exported them in Windows-style:
set SSH_AUTH_SOCK=/tmp/ssh-QihvHx3336/agent.3336
set SSH_AGENT_PID=6380

2. Then I ran ssh-add:
ssh-add "path-to-key"

e.g.
ssh-add "c:\my\dir\rsa_id"

3. Ran keys:add:
heroku keys:add

4. And finally I was able to push my code to the GIT repository:
git push heroku master
Comments
Thanks man! Worked like a charm
Added on 23-01-2014 22:24 by anonymous
Great! It helped me a lot. Thanks :)
Added on 15-09-2014 21:21 by anonymous

 

Add comment

Has this tutorial been helpful to you? Or do you see anything wrong? We appreciate your opinion!
Your comment:
Show formatting hints
HTML is disallowed, but in your text you can use the following markup
  • [code][/code] for a block of code
  • [tt][/tt] for inline code
  • [link]link href|link anchor[/link] for links
  • [b][/b] for bold text
Email:
+ Ask a question
If you have a technical question related to programming and computers, ask it here. Other users will help you solve it!
Unanswered questions
Share your knowledge by helping others solve their problems