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 sshed 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
sshport onserverA, in your.ssh/configadd something like:Then start the tunnel (on
serverA) with:After this you can clone the repo (from your windows box) using:
Create the tunnel directly from
Putty(see here for more details). Basically:serverB:serverA(that will have the tunnel defined):This way, on your windows box (assuming that the above session is started), you will be able to clone the repo, using: