Ssh mercurial hg从通过另一台服务器连接的服务器克隆repo
我有三台机器Ssh mercurial hg从通过另一台服务器连接的服务器克隆repo,ssh,mercurial,tortoisehg,hgrc,Ssh,Mercurial,Tortoisehg,Hgrc,我有三台机器 local (windows) serverA (linux) with username as userA serverB (linux) with username as userB 我想使用TortoiseHg for windows将serverB中的hg存储库克隆到我的本地计算机。机器serverB只能通过serverA进行sshed。因此,在winScp/PuTTY中,我使用隧道选项通过serverA连接到serverB。但是我怎么用乌龟来做呢 显然,我不能使用hg克
local (windows)
serverA (linux) with username as userA
serverB (linux) with username as userB
我想使用TortoiseHg for windows将serverB
中的hg存储库克隆到我的本地计算机。机器serverB
只能通过serverA
进行ssh
ed。因此,在winScp/PuTTY中,我使用隧道选项通过serverA
连接到serverB
。但是我怎么用乌龟来做呢
显然,我不能使用hg克隆ssh://userB@服务器B://
。但是有没有一种方法可以使用多个ssh命令呢。我尝试了以下方法,但无效:
$cat~/.ssh/config
host serverB.example.com serverB
ProxyCommand /usr/bin/ssh serverA.example.com /usr/bin/nc %h %p
您有以下选项:
.ssh/config
中转发serverA
上的ssh
端口,添加如下内容:
host serverBtunnel
LocalForward 2222 serverB.example.com:22
然后使用以下命令启动隧道(在服务器A上):
在此之后,您可以使用以下方法(从windows框)克隆回购:
你说的“不起作用”是什么意思?您是否也尝试了代理命令的
-w
方式?我的本地计算机windows。错误的所有者或对~/.ssh/config
的权限。我需要设置此文件的权限吗.ssh
目录上的权限应该是700
,对于config
您应该使用640
。我认为我添加的putty替代方案更简单,您不再需要登录serverA
。但是在第一个选项中,要在serverA
上启动该隧道,您将使用ssh-NuserA@serverBtunnel
UserA@serverBtunnel? 难道不是吗userB@serverBtunnel?
ssh -N serverBtunnel
hg clone ssh://userB@serverA:2222//<path to repo>
hg clone ssh://userB@localhost:2222//<path to repo>