簡體   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