hg clone via ssh tunnel

Matt Mackall mpm at selenic.com
Tue Apr 13 16:47:46 CDT 2010


On Mon, 2010-04-12 at 18:22 -0400, Jean-Claude Passy 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 ?

This is really just an ssh question, but you might want to do something
like this in your .ssh/config:

Host protected
Hostname protected.foo.com
ProxyCommand ssh firewall.foo.com /usr/bin/nc protected.foo.com 22

When you run "ssh protected", ssh will first run the proxy command to
create a raw connection to protected machine, then negotiate ssh over
it. Then you can "ssh protected" in one step and ssh://protected will
work with hg.

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial mailing list