I'm trying to SCP from one ec2 instance to another (via SSH client). Both server use the same keys.

My initial investigation into this led me to believe this would all be possible by using AgentForwarding like so:

scp -o "ForwardAgent yes" -v /path/to/file ec2-user@xx.xx.xx.xx:/path/to/file

which creates output ending with:

> debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22. debug1:
> connect to address xx.xx.xx.xx port 22: Connection timed out ssh:
> connect to host xx.xx.xx.xx port 22: Connection timed out lost
> connection

Alternatively I've also tried specifying a keyfile with -i, but I only have .ppk and .key file versions, not a .pem like most examples show. I also have no file at /home/ec2-user/.ssh/id_rsa (all that is in .ssh dir is 'config', 'known_hosts', and 'authorized_keys') which seems to be a solution that many people use.

I've tried editing the config and adding AgentForwarding yes there too.

Nothing seems to work, I get the same time out message eventually on all attempts.

I've been met with a lot of resistance on this one, so any help would be appreciated. Thank you!

  • 1
    Do your security groups allow this traffic? – EEAA Dec 9 '15 at 6:18
  • Mate you did it, you gave me my a-ha moment with your phrasing. I believed that since I was allowed to putty in, it would all be apples. How embarrassing for me. It works now. – braks Dec 9 '15 at 6:35
  • Great, I've posted an answer below. Cheers! – EEAA Dec 9 '15 at 13:08

First thing I would check would be to ensure that your Security Groups allow this inter-server traffic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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