hg clone via ssh tunnel

Satish Balay balay at fastmail.fm
Tue Apr 13 17:37:15 CDT 2010


On Wed, 14 Apr 2010, Benoit Boissinot wrote:

> On Tue, Apr 13, 2010 at 04:34:31PM -0500, Satish Balay wrote:
> > On Tue, 13 Apr 2010, Benoit Boissinot wrote:
> > > On Tue, Apr 13, 2010 at 12:22 AM, Jean-Claude Passy <jcpassy at gmail.com> wrote:
> > > > Dear all,
> > > >
> > > > I want to clone a repository from one machine to another. The problem is I
> > > > have to go through a gateway, so I cannot type in something like
> > > >
> > > > $ hg clone ssh://name@remotemachine/path/to/folder .
> > > >
> > > >
> > > > I don't know how to mix ssh tunneling, so could anyone explain to me how to
> > > > proceed ?
> > 
> > > there might be a better way to do it with a very recent ssh.
> > 
> > If you can ssh from 'localhost to gateway' and then from 'gateway to
> > remotemachine' - then you can setup a ssh over ssh tunnel and use as:
> > 
> > <terminal1>
> > ssh -L10212:remotemachine:22 gateway [-N]
> > 
> > <terminal2>
> > hg clone -e 'ssh -p 10212' ssh://localhost//path/to/folder
> 
> That's more complicated/less convenient than using ProxyCommand :)

Perhaps this is a bit more compliated to setup. I guess for me
port-forwarding is more understandable than the ProxyCommand/nc
magic.. :)

Satish


More information about the Mercurial mailing list