scp over existing ssh tunnels?
Thomas Charron
twaffle at gmail.com
Mon Jul 30 10:19:00 EDT 2007
On 7/30/07, Paul Lussier <p.lussier at comcast.net> wrote:
> Hi all,
> I could just scp it directly, but that opens up another connection.
> The goal is to re-use the existing connection. In my config file, I
> have:
> host *
> ControlMaster yes
> ControlPath /tmp/%r@%h:%p
> This allows me to then do:
> ssh -S /tmp/pll at taz:22 taz.mydomain.org
> which is, by the way, superfast, and avoids any re-authentication (and
> since I use OTP for ssh'ing to my home system, it's very nice :)
> I *thought* I could use scp in this manner, but -S for ssh is
> different from -S for scp.
I had thought that the OpenSSH libraries would figure out to
automagically use the shared connection, but I might be wrong.
In any case, the -S parameter is *still* the way to go, but in a
different method. :-) -S in scp specifies the application to use
which will take the same parameters as SSH. I'd image you could
simply use a shell script like scp_ssh which calls ssh passing all
params passed to it, but adding the -S option, and have ssh_config
configured to use like:
/tmp/pl at taz:22
Then have the script do a regex match on it's own command line and call:
ssh -S /tmp/ARGUMENT ARGUMENT
--
-- Thomas
More information about the gnhlug-discuss
mailing list