Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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've followed the steps in this tutorial:

but when I came to the step "push our local code changes to the remote repository" I got an error.

I'm running a Windows 7 pc and using putty to access my AWS EC2 instance. My Git client is msysgit.

When I try to push to ec2 I get the following error:

Pushing to ssh:// Permission denied (publickey). fatal: The remote end hung up unexpectedly

I've tried using the almighty Google machine but I can't seem to type in the correct search terms to get an answer that works.

Any pointers that can make the push possible would be appreciated.

share|improve this question

You need to copy your public SSH key to the server. Done by using pscp.exe and the command (in command prompt):

"c:\Program Files\Putty\pscp.exe"


  • first part is the path to pscp.exe
  • 2nd part is my public part of my SSH key and
  • 3rd part is username@remote_computer:path_on_remote_computer

pscp.exe can be found at the PuTTY download page.

share|improve this answer

thanks for the answer, just adding my 2 cents,

we need to add the current aws key to login using pscp

"c:\Program Files\Putty\pscp.exe" -i "current_aws_key""

Also we need to use the new key the next time we need to putty into the linux.

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.