Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does scp traffic flow between two remote hosts?

Tags:

scp

rsync

sftp

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
like image 564
user153466 Avatar asked Aug 04 '10 16:08

user153466


People also ask

Can you SCP between two remote hosts?

The scp command copies files or directories between a local and a remote system or between two remote systems. You can use this command from a remote system (after logging in with the ssh command) or from the local system. The scp command uses ssh for data transfer.

How do I SCP between two computers?

To copy a directory (and all the files it contains), use scp with the -r option. This tells scp to recursively copy the source directory and its contents. You'll be prompted for your password on the source system ( deathstar.com ). The command won't work unless you enter the correct password.

Does SCP use SSH?

The SCP command relies on SSH for secure data transfer, meaning it requires a password to authenticate on remote systems. Watch out when copying files with the same name and location, as SCP will overwrite them without warning you.


2 Answers

Looks like it can be done.

like image 45
user153466 Avatar answered Sep 28 '22 00:09

user153466


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.

like image 115
chiborg Avatar answered Sep 27 '22 23:09

chiborg