2012-07-26 12 views
0

在我的研究所,我只能通過代理訪問受限制的Internet。我在建立與gerrit代碼審查系統(git.eclipse.org)的ssh連接時遇到了一些嚴重問題,因此無法將任何新補丁推送到Gerrit。無法通過代理使用開瓶器來建立ssh連接來蝕刻gerrit

爲了執行上述任務,我先用開塞鑽試圖隧道SSH通過HTTP,下面給出here 說明這是我做過什麼:

  1. 安裝開瓶器
  2. 新增ProxyCommand到ssh配置
  3. 新增代理用戶名和代理認證密碼文件 的〜/ .ssh/proxyauth

在此之後,我成功地建立了一個連接到github的ssh,並將更改推送到我的github回購。

但我無法通過ssh連接到gerrit。這是確切的錯誤:

$ssh -p 29418 [email protected] 
Proxy could not open connnection to git.eclipse.org: Forbidden 
ssh_exchange_identification: Connection closed by remote host 

我使用Linux(RHEL 6.3測試版x86_64)和git 1.7.11.1(最新版)。
我的〜/ .ssh /配置的內容是:

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 

遠程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://[email protected]:29418/etrice/org.eclipse.etrice.git (fetch) 
review ssh://[email protected]:29418/etrice/org.eclipse.etrice.git (push) 

前幾天,當我有直接上網,我能夠通過ssh連接,也把我的補丁,上述遠程設置。

我試圖刪除known_hosts的內容,但這並沒有幫助。
這是gerrit服務器的問題嗎?

在此先感謝您的幫助。

回答

0

我覺得問題是由於非支持的服務器配置。這是我在網絡博客中,後發現:

的基本想法是,你會以某種方式調用socat(類似於公用事業 到開瓶器),將與HTTP(S)代理服務器 談判使用CONNECT方法爲您提供一條幹淨的管道,通往遠端的服務器。
...
注意到許多企業防火牆阻止訪問 CONNECT方法在443以外的端口,在GitHub上的好鄉親有 SSH服務器監聽443,如果你使用的主機「ssh.github。COM」, 這樣你就可以更換主機名,並在上面的ssh配置 節適當的端口,你都設置

上述提取物已經從here拍攝。

我感覺是,因爲gerrit正在端口29418上運行,並且由於代理通常只允許在遠程主機(服務器)的端口443上訪問CONNECT方法,所以針對gerrit的ssh請求無法在代理上協商。這在github中不會發生,因爲它在端口443和客戶端實用程序上提供ssh請求(例如軟木塞)可以通過在遠程服務器的端口443上發送發送請求來協商代理(如上面的.ssh/config的快照中所做的那樣)。

有沒有人知道執行上述任務的其他方法?

相關問題