I want to move a directory from one host to another. This is my command:
scp -r host1:filepath host2:filepath
I get this error:
ssh: Could not resolve hostname host2: Name or service not known
lost connection
host1
and host2
are present in my ~/.ssh/config
, and I can connect to them with ssh host1
and ssh host2
without problem.
Why does scp fail to connect to host2
?