The thing is, you can specify a port to SCP, and you can transfer stuff from a remote host to another.
If both hosts use different ports on SSH (i.e. 2203 and 2541), how can I specify these ports to the SCP command?
I know I can do
scp -P <port> host1:/file host2:/file
But that port will apply to both hosts.
So… how can I specify two different ports for the two different hosts?
Best Answer
After tink's comment: I think this may not apply to Linux, but to BSD systems:
The source and target can be specified as a URI in the form scp://[user@]host[:port][/path]
so you can run:
And to copy between two remote hosts through the local host add "-3":