繁体   English   中英

无法使用软木塞通过代理建立与Eclipse Gerrit的SSH连接

[英]Unable to establish ssh connection to eclipse gerrit via proxy using corkscrew

在我院,我只有通过代理受限制的互联网接入。 在建立与gerrit代码检查系统(git.eclipse.org)的ssh连接时,我面临一些严重的问题,因此无法将任何新补丁推送到Gerrit。

为了执行上述任务,我首先按照此处给出的说明尝试使用corkscrew在HTTP上通过SSH隧道传输。

  1. 已安装的开瓶器
  2. 在ssh配置中添加了ProxyCommand
  3. 在文件〜/ .ssh / proxyauth中添加了代理用户名和代理身份验证密码

此后, 我成功设置了一个连接到github的ssh,并将更改推入/拉入我的github存储库。

但是我无法通过ssh连接到Gerrit。 这是确切的错误:

$ssh -p 29418 jgupta@git.eclipse.org
Proxy could not open connnection to git.eclipse.org:  Forbidden
ssh_exchange_identification: Connection closed by remote host

我正在使用Linux(RHEL 6.3 Beta x86_64)和git 1.7.11.1(latest)。
我的〜/ .ssh / config的内容是:

Host github.com
  Hostname ssh.github.com
  Port 443
  ProxyCommand corkscrew 202.141.80.22 3128 %h %p ~/.ssh/proxyauth

Host *
  ProxyCommand corkscrew 202.141.80.22 3128 %h %p ~/.ssh/proxyauth

ssh请求git.eclipse.org的详细(错误)结果是:

penSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /home/jayant/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Executing proxy command: exec corkscrew 202.141.80.22 3128 git.eclipse.org 29418 ~/.ssh/proxyauth
debug1: permanently_drop_suid: 500
debug1: identity file /home/jayant/.ssh/identity type -1
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug2: key_type_from_name: unknown key type '-----END'
debug1: identity file /home/jayant/.ssh/id_rsa type 1
debug1: identity file /home/jayant/.ssh/id_dsa type -1
Proxy could not open connnection to git.eclipse.org:  Forbidden
ssh_exchange_identification: Connection closed by remote host

我的git repo中设置的远程URL是:

$git remote -v
origin  http://git.eclipse.org/gitroot/etrice/org.eclipse.etrice.git (fetch)
origin  http://git.eclipse.org/gitroot/etrice/org.eclipse.etrice.git (push)
review  ssh://jgupta@git.eclipse.org:29418/etrice/org.eclipse.etrice.git (fetch)
review  ssh://jgupta@git.eclipse.org:29418/etrice/org.eclipse.etrice.git (push)

几天前,当我可以直接访问Internet时,可以使用上述远程设置通过ssh连接并推送补丁。

我尝试删除known_hosts的内容,但这无济于事。
这在Gerrit服务器上有问题吗?

在此先感谢您的帮助。

我认为问题是由于服务器配置不支持所致。 这是我在网上的博客文章中找到的:

基本思想是,您将以某种方式调用socat(类似于corkscrew的实用程序),它将使用CONNECT方法与HTTP(S)代理服务器进行协商,以使您获得通往远端服务器的干净管道。
...
注意到许多公司防火墙禁止访问除443以外的其他端口上的CONNECT方法,如果您使用主机“ ssh.github.com”,则github上的老兄都有ssh服务器侦听443,因此可以替换主机名和上面的ssh config节中的port,就一切就绪

以上摘录摘自这里

我的感觉是,由于Gerrit在端口29418上运行,并且由于代理通常只允许对远程主机(服务器)的端口443上的请求访问CONNECT方法,因此无法在代理服务器上协商gerrit的ssh请求。

github不会发生这种情况,因为它在端口443上服务ssh请求,并且客户端实用程序(例如corkscrew)可以通过在远程服务器的端口443上发送发送请求来协商代理(如上面.ssh / config的快照中所述) 。

有谁知道执行上述任务的其他方法?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM