I've followed the steps in this tutorial: http://cuppster.com/2011/05/12/diy-node-js-server-on-amazon-ec2

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://ubuntu@ec2-xx-xx-xxx-xx.compute-1.amazonaws.com/home/ubuntu/repository 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.

link|improve this question
feedback

2 Answers

Found the error. Needed to copy my public ssh key to the server. Done by using pscp.exe and the command (in command prompt):

"c:\Program Files\Putty\pscp.exe" id_rsa.pub ubuntu@ec2-xx-xx-xxx-xx.compute-1.amazonaws.com:.ssh/authorized_keys

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

pscp.exe can be found at the putty download page http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

link|improve this answer
feedback

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" id_rsa.pub -i "current_aws_key" ubuntu@ec2-xx-xx-xxx-xx.compute-1.amazonaws.com:.ssh/authorized_keys"

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.