Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I try to copy files between two hosts, of which the second is identified by an alias:

scp host:foo alias:

scp tries to resolve alias by looking into host:.ssh/config and not my local ~/.ssh/config -- in other words, as if I've ssh-ed to host and then executed scp foo alias:.

Of course, this fails if I do not have the alias alias defined on host. Is this the intended behavior?

Running Ubuntu 13.04.

share|improve this question

migrated from stackoverflow.com May 31 '13 at 19:15

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 3 down vote accepted

Indeed, the scp host1:foo host2: is the same as doing scp foo host2: on host1 (The scp, more or less, first connects to host1 and executes scp foo host2: there).

If you want to transfer files via local host (what I believe would also mean the alias is resolved locally), add switch -3:

-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.

http://www.openbsd.org/cgi-bin/man.cgi?query=scp&sektion=1

share|improve this answer
    
Oh God. scp has options -1, -2, -3, -4 and -6 with three different "groups" of meanings. Shudder Anyway, thanks, that's it. –  Irfy Jun 2 '13 at 23:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.