Is there a way to use scp -3
to copy a file from one remote host to another, where both use non-standard SSH ports, without configuring each host involved in ~/.ssh/config
?
I've seen suggestions that -P xxxx
can be used before each file argument, like this:
scp -3 -P 9000 localhost:source_file -P 9001 localhost:remote_file
But I get:
-P: No such file or directory
9001: No such file or directory
on Ubuntu 17.04.
Note that the above isn't quite as insane as it looks; both localhost ports involved are actually themselves SSH tunnels to another host.