3

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://[email protected]/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.

2 Answers 2

3

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" id_rsa.pub [email protected]:.ssh/authorized_keys

Where

  • 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.

1

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" [email protected]:.ssh/authorized_keys"

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .