I have three machines
local (windows)
serverA (linux) with username as userA
serverB (linux) with username as userB
I want to clone a hg repository in serverB
to my local machine using TortoiseHg for windows. The machine serverB
can be ssh
ed only though serverA
. So in winScp/PuTTY I use tunneling option to connect to serverB
through serverA
. But how do I do it in TortoiseHg?
Obviously I cannot use hg clone ssh://userB@serverB://<path to repo>
. But is there a way to use multiple ssh commands`. I tried the below approach and it did not work:
$cat ~/.ssh/config
host serverB.example.com serverB
ProxyCommand /usr/bin/ssh serverA.example.com /usr/bin/nc %h %p
You have the following options:
You can forward the ssh
port on serverA
, in your .ssh/config
add something like:
host serverBtunnel
LocalForward 2222 serverB.example.com:22
Then start the tunnel (on serverA
) with:
ssh -N serverBtunnel
After this you can clone the repo (from your windows box) using:
hg clone ssh://userB@serverA:2222//<path to repo>
Create the tunnel directly from Putty
(see here for more details). Basically: