Transferring file to local machine when SSHing into a foreign box

Peter Stuge peter at stuge.se
Wed May 9 08:10:33 EST 2012


Dotan Cohen wrote:
> The ControlMaster option allows for the reuse of a session, but does
> not provide any nice "cpLocal" command for easily moving files from
> the remote machine to local (or vice versa).

It allows sftp on your local machine to reuse a session to a remote
machine.


But in the other direction things are a lot more complicated:

1. Your local machine runs an SSH client.
2. Your remote machine runs the SSH server.

The SSH protocol allows the SSH server to spontaneously open a
channel back to the SSH client, so cpLocal could somehow signal
the SSH server to open such a channel, but the problem is that your
SSH client has no idea what to do with this new channel.

The SFTP protocol is well-specified, but it is only specified in the
context of an SSH client requesting an SSH server to start the sftp
subsystem in a channel which the client just opened.

While it is legal in the SSH protocol for the SSH server to try to
open an sftp channel to the SSH client, the SSH client does not
really know how to accomodate this wish. I think you agree that it
is also undesirable from a security point of view.


I'll reply with a counter-question:

How would you like the user-interface on the client side to work for
the cpLocal feature?


//Peter


More information about the openssh-unix-dev mailing list