openssh and multiple ports

Adam McKenna adam-dated-1000237541.bcd841 at flounder.net
Fri Sep 7 05:45:40 EST 2001


On Thu, Sep 06, 2001 at 12:44:11PM -0700, Kevin Steves wrote:
> On Thu, 6 Sep 2001, Adam McKenna wrote:
> :Sorry to add more fuel to this fire, but since we're having the discussion
> :anyway, it bears mentioning that SCP claims to support copying files
> :between *two* remote machines.  (i.e., using a third machine as an
> :intermediate).  This breaks if ssh is running on a different port on either
> :machine.  There should be a way to set the port for both source and
> :destination.
> 
> i wonder how many people use third-party copies?

The issue here is not how many people use the feature.  The SCP documentation
says it supports this feature, but it doesn't work in all cases.  If the
feature is not supported for hosts running sshd on different ports, then the
documentation should be modified to indicate that.

> third-party copies work by changing:
> scp user1 at host1:dir/foo user2 at host2:dir/bar
> to:
> ssh -l user1 host1 scp dir/foo user2 at host2:dir/bar

A number of workarounds exist for this problem.  Again, this is not the
point.  See above.

> if we add some special port notation to the path, what happens when host2
> scp does not recognize it?  the way to do this is to handle -o properly
> (it's not handled at all now for third-party copies).
> 
> scp -oport=2222 user1 at host1:dir/foo -oport=3333 user2 at host2:dir/bar
> then we get:
> ssh -l user1 -oport=2222 host1 scp -oport=3333 dir/foo user2 at host2:dir/bar
> 
> it may not be that hard to fix this with optreset, but i'm not sure it's
> worth it.

If I'm reading you correctly, what you're saying is that third party copies
work by sending host1 an scp command which tells it to copy the file directly
from host1 to host2.  I thought this feature was supposed to enable secure
file copy between two hosts that cannot reach each other at all, through a
third host that is reachable by both.  Is this not the case?

--Adam

-- 
Adam McKenna <adam at flounder.net>   | GPG: 17A4 11F7 5E7E C2E7 08AA
http://flounder.net/publickey.html |      38B0 05D0 8BF7 2C6D 110A



More information about the openssh-unix-dev mailing list