I have one big file on server one and I want to copy it to server two using scp. I have the keys setup properly and I can ssh/scp to both servers from my desktop.The file I need to copy is larger then the free space on my workstation's hdd, so I wanted to do:scp one:/opt/bigfile.tar.gz two:/opt/bigfile.tar.gzbut I got:ssh: Could not resolve hostname one: Name or service not knownWe do not have DNS here (don't ask me why), so I have this in my ~/.ssh/config:Host one    Hostname        <IP address of server one>    User            jspurnyHost two    Hostname        <IP address of server two>    User            jspurnyIf I try with a smaller file and transfer it from one to my workstation and then to two, it works fine:scp one:/opt/smallerfile.tar.gz .scp smallerfile.tar.gz two:/opt/When using IP addresses directly as suggested in comment, I got:$ scp jspurny@<one's IP>:bigfile.tar.gz jspurny@<two's ip>:bigfile.tar.gzHost key verification failed.lost connectionNot an issue:The size is not an issue here - it was only a trigger to this problem as there was no way to store bigfile.tar.gz on my workstation.The problem occurs regardless of the file size.Question:Why does the command:scp oneremote:file secondremote:filethrows an error regardless if using .ssh/config aliases or directly using ip addresses?Solved - sort of - still looking for explanation - I've split the bigfile into smaller files and transfered them one by one through my workstation. I'm still wondering why it didn't work. So I would still appreciate some explanation of what was wrong ..Found a reason why it fails: It seems I was being foolish. I thought that the command scp one:file two:filewas creating two connections to each server and then receive data from one and immediately send them to two and thus acting like a relay.This is clearly not the case, because a simple -v option revealed that it in fact just connects to one and from one it tries to connect to two. Which obviously isn't possible because server one is not supposed to connect to two.
scp from one remote server to another remote server
debian;scp
Simple pipeTry this:ssh one 'cat file' | ssh two 'cat > file'The first one should send the file content to your machine, while the second should send that on to second machine. I would compute a checksum at both ends after the transfer, to ensure that nothing got lost or garbled along the way.Elaborate tunnelsFor more elaborate applications, you could use ssh tunnels. For example, you could try something like this:ssh -R 5001:127.0.0.1:5002 onessh -L 5002:127.0.0.1:22 twoThen you can open a connection on one to machine localhost port 5001 and it will be forwarded twice and end up as a connection on two to localhost port 22. This is the ssh port, so you can use this for yet another scp, or for rsync, or whatever. You could also start an rsync server on two, and forward port 873 instead of 22. Or you could use nc on both sides to transfer raw data, using an arbitrary port number.The main benefit between the above approach is that you have a two-directional tcp connection between the two machines, instead of a one-directional pipe only. That way, the two parties can exchange information, which is particularly important in the rsync case.