Neither SCP nor SFTP have inherent support for (FXP-like) direct file
transfers between two remote hosts. You always have to SSH into one of
the boxes and initiate the transfer from the remote box by running the
necessary command.

scp [email protected]:file [email protected]:newfile
is equivalent to
ssh [email protected] "scp file [email protected]:newfile"

Regards
Tilo

Am 02.08.2018 um 16:13 schrieb Ahmad Modaghegh:
> As mentioned in documentation (tuts), by using SCP and SFTP, It is
> possible to transfer a set of *LOCAL* file (or directories) through a
> secure SSH connection. But is it possible to transfer Files located on a
> public remote to another one?
> 
> Let's say there is host (serving sshd): x.x.x.x:22 and there is another
> one: y.y.y.y:22 (both on different machines). Now is it possible to
> transfer a file from the first one to another one using lib APIs
> directly (by sending the command from a third-machine)? I'm sure it is
> possible natively on ssh (CLI) as below:
> 
> scp [email protected]:file [email protected]:newfile
> 
> Thanks in advance.
> 
> 


Reply via email to