SCP – SCP from One External Server to Another

bashlinuxscpssh

I am trying to use SCP on my local server to copy a file from one remote server to another remote server (both remote servers use a custom port (xxxx)

I am trying:

scp -r -P xxxx root@xxx.xxx.xxx.111:/home/myimages/images.tar.gz root@xxx.xxx.xxx.222:/home/myimages/images.tar.gz

But I get the following error:

ssh: connect to host xxx.xxx.xxx.222 port 22: Connection timed out

Any suggestions?

Best Answer

did you check that direct authentication works from first remote host to the second one?

scp user@host:/file user@otherhost:/otherfile is shorthand for

ssh user@host scp /file user@otherhost:/otherfile

which leeds me to think:

ssh -p XXX user@host scp -P XXX /file user@otherhost:/otherfile might work.

Related Question