0

I mean to copy files from one remote server to another.

If using scp -3, command succeeds (I have remote1 and remote2 in my ~/.ssh/config)

$ scp -p -3 remote1:dir1/file1 remote2:dir2/

but when not using -3, it fails

$ scp -p remote1:dir1/file1 remote2:dir2/
ssh: Could not resolve hostname remote2: Temporary failure in name resolution
lost connection

Why is that?

As I understand from man scp and other sources, -3 is not mandatory, but simply

-3      Copies between two remote hosts are transferred through the local host.  Without this option the data is copied directly between the two remote hosts.

I am using msys2, I wouldn't know if that makes any difference.

muru
  • 69,900
  • 13
  • 192
  • 292

0 Answers0