简体   繁体   English

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

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

At my institute, I have a restricted internet access only through a proxy. 在我院,我只有通过代理受限制的互联网接入。 I am facing some serious problems in establishing a ssh connection to the gerrit code review system ( git.eclipse.org ) and thus unable to push any new patch to Gerrit. 在建立与gerrit代码检查系统(git.eclipse.org)的ssh连接时,我面临一些严重的问题,因此无法将任何新补丁推送到Gerrit。

For carrying out the above task, I firstly tried to tunnel SSH over HTTP using corkscrew, following the instructions given here This is what I did : 为了执行上述任务,我首先按照此处给出的说明尝试使用corkscrew在HTTP上通过SSH隧道传输。

  1. Installed corkscrew 已安装的开瓶器
  2. Added ProxyCommand to ssh config 在ssh配置中添加了ProxyCommand
  3. Added proxy username and proxy authentication password to file ~/.ssh/proxyauth 在文件〜/ .ssh / proxyauth中添加了代理用户名和代理身份验证密码

After this, I was successful in setting up a ssh connecting to github and also push/pull changes to my github repo. 此后, 我成功设置了一个连接到github的ssh,并将更改推入/拉入我的github存储库。

But I am unable to connect to gerrit through ssh. 但是我无法通过ssh连接到Gerrit。 Here is the exact error : 这是确切的错误:

$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

I am using Linux (RHEL 6.3 Beta x86_64) and git 1.7.11.1(latest). 我正在使用Linux(RHEL 6.3 Beta x86_64)和git 1.7.11.1(latest)。
The contents of my ~/.ssh/config are : 我的〜/ .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

The verbose (error)result for ssh request to git.eclipse.org is : 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

The remote url set in my git repo is : 我的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)

A few days ago, when I had direct internet access, i was able to connect via ssh and also push my patches, with the above remote settings. 几天前,当我可以直接访问Internet时,可以使用上述远程设置通过ssh连接并推送补丁。

I tried deleting the contents of the known_hosts but this didn't help. 我尝试删除known_hosts的内容,但这无济于事。
Is this a problem at gerrit server? 这在Gerrit服务器上有问题吗?

Thanks in advance for your help. 在此先感谢您的帮助。

I feel that the problem is due to non-supportive server configuration. 我认为问题是由于服务器配置不支持所致。 This is what I found in a blog-post on web : 这是我在网上的博客文章中找到的:

The basic idea is that you will somehow invoke socat(a utility similar to corkscrew), which will negotiate with the HTTP(S) proxy server using the CONNECT method to get you a clean pipe to the server on the far side. 基本思想是,您将以某种方式调用socat(类似于corkscrew的实用程序),它将使用CONNECT方法与HTTP(S)代理服务器进行协商,以使您获得通往远端服务器的干净管道。
... ...
Noting that many corporate firewalls block access to the CONNECT method on ports other than 443, the good folks at github have an ssh server listening on 443 if you use the host "ssh.github.com", so you can replace the hostname and the port in the above ssh config stanza as appropriate, and you're all set 注意到许多公司防火墙禁止访问除443以外的其他端口上的CONNECT方法,如果您使用主机“ ssh.github.com”,则github上的老兄都有ssh服务器侦听443,因此可以替换主机名和上面的ssh config节中的port,就一切就绪

The above extract has been taken from here . 以上摘录摘自这里

What i feel is, since gerrit is being run on port 29418 and since proxies generally allow access to CONNECT method only for request on port 443 of remote host(server), so the ssh request for gerrit cannot to negotiated at the proxy. 我的感觉是,由于Gerrit在端口29418上运行,并且由于代理通常只允许对远程主机(服务器)的端口443上的请求访问CONNECT方法,因此无法在代理服务器上协商gerrit的ssh请求。

This doesn't happen with github as it serves ssh requests on port 443 and the client utilities (like corkscrew) could negotiate proxies by sending send request on port 443 of the remote server(as done in the snapshot of .ssh/config above). github不会发生这种情况,因为它在端口443上服务ssh请求,并且客户端实用程序(例如corkscrew)可以通过在远程服务器的端口443上发送发送请求来协商代理(如上面.ssh / config的快照中所述) 。

Does anyone know some other method for carrying out the above task? 有谁知道执行上述任务的其他方法?

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

相关问题 无法在 Eclipse 中建立到 Oracle DBMS 的 JDBC 连接 - Unable to establish JDBC connection to Oracle DBMS in Eclipse 无法在Eclipse IDE中使用Java建立与SQL Server 2008的数据库连接 - Unable to establish database connection to SQL Server 2008 using java in Eclipse IDE 当proxifier运行时,eclipse说“无法建立环回连接” - when proxifier is running, eclipse says “Unable to establish loopback connection” Eclipse:无法初始化Monitor Thread:无法建立环回连接 - Eclipse: Failed to initialize Monitor Thread: Unable to establish loopback connection 无法在eclipse中建立数据库连接 - Not able to establish database connection in eclipse Eclipse问题代理连接:无法保存安全首选项 - Eclipse issue proxy connection: unable to save secure preferences 运行Eclipse后,“无法初始化Monitor Thread:无法建立环回连接” - “Failed to initialize Monitor Thread: Unable to establish loopback connection” after running Eclipse Eclipse通过SSH代理连接到MySql,但没有数据库限定符就无法查询 - Eclipse to MySql via SSH proxy connects but can't query without a database qualifier 无法使用 https 和 Z765553E6C7AC85A00AZ 链接9ACB8 克隆 Eclipse 中的 git 存储库 - Unable to clone git repository in Eclipse using https and SSH links SSH通过Eclipse跳转主机 - SSH Jump Host via Eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM