I\'m trying to copy a file from one remote server to another remote server from my local machine. Here\'s what I\'m trying
The existing answers assume you can ssh back to the local machine from the remote machines. That's not always possible. In such case, you can use a jump host mechanism. It's actually more efficient anyway.
If you have a recent OpenSSH (8.0), you can use the -J (jump) switch:
scp -J user@intermediate user@target:/path
With older versions (but at least 7.3), you can use ProxyJump directive, either on command-line:
scp -o ProxyJump=user@intermediate user@target:/path
or in ssh_config file.
There are other options like ProxyCommand or port forwarding, which you can use on even older versions of OpenSSH. These are covered in Does OpenSSH support multihop login?