Just because it hit me today:
If your remote servers remote1
and remote2
don't share a secure connection you won't be able to copy files the naïve way:
$ scp remote1:tmp/planets-snapshot-201611090746.tar remote2:tmp
ssh: Could not resolve hostname remote2: Name or service not known
lost connection
I wanted to avoid two separate commands and did some research:
The scp
option -3
to the rescue:
$ scp -3 remote1:tmp/planets-snapshot-201611090746.tar remote2:tmp