How does scp traffic flow between two remote hosts?

user153466 picture user153466 · Aug 4, 2010 · Viewed 9.5k times · Source

If you issue a scp command between 2 remote servers, will the traffic flow directly between the hosts, or will it flow from Remote1 => Local Machine => Remote2?

For example I issue this command on my laptop:

scp [email protected]:/Files [email protected]:/Files

Answer

chiborg picture chiborg · Apr 24, 2012

Newer versions of scp (since 2011) have the option -3 which will route the traffic through your local machine. This is useful if the hosts are on different networks and can't see each other. Found this on SuperUser. From your linked article it seems like normally the hosts will try to connect directly to each other.