I have encountered SCP through SSH-forwarding in cases where
VM-A <---> VM-B <---> VM-C and a file is needed to be transferred from A to C or vice versa, ie. B is the Jumpbox in this scenario.
In my case, through my localhost, I have access to 2 VMs and I want to share files between them.
VM-A <---> VM-B VM-A <---> VM-C and file transfer needs to be done between B and C. (A is my localhost where I can run SSH commands)
Now, one way to this is:
- SCP from B to A, then SCP again from A to C.
However, since SCP command just takes source & destination as inputs, I thought simply this would work:
scp user@VM-B user@VM-C if I run this on A, since A has necessary authorisations. However, this results in:
Host key verification failed. lost connection So, what is the way to overcome this and move data from B to C directly?