hg clone via ssh tunnel

Satish Balay balay at fastmail.fm
Tue Apr 13 16:34:31 CDT 2010


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


Note: 10212 is an arbitary local port I choose - but it can be any [unused] value.

Satish


More information about the Mercurial mailing list