Ssh – Connection timed out when trying to SCP from one EC2 instance to another

amazon ec2scpsshssh-keys

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!

Best Answer

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