SSH 在收到 SSH2_MSG_SERVICE_ACCEPT 時不斷掛起

SSH 在收到 SSH2_MSG_SERVICE_ACCEPT 時不斷掛起

我在使用 SSH 時遇到問題。我無法連接到任何東西;每個連線都在 SSH2_MSG_SERVICE_ACCEPT RECEIVED 處無限期掛起。我使用的是 OSX 10.6.8。

我認為這是我的 SSH 配置的問題,但我無法弄清楚。我將 os x 附帶的原始 openssh 安裝在 /usr/bin/ 中,並在 /usr/local/bin/ 中安裝了breed 安裝。我正在使用自製軟體 - 這裡可能會發生一些衝突嗎?

有關解決方案的任何想法或可能導致此問題的原因是什麼?這是我的 ssh_config:

 Host *
#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
   IdentityFile ~/.ssh/identity
   IdentityFile ~/.ssh/id_rsa
   IdentityFile ~/.ssh/id_dsa
   Port 22
#   Protocol 2,1
   Cipher 3des
   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
   MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no

答案1

您正在連接的主機(執行伺服器的主機sshd,而不是執行ssh用戶端的主機)可能掛在此處,因為它嘗試(然後逾時並失敗)ssh根據 IP 位址。

一種解決方法是編輯 /etc/sshd_configsshd伺服器電腦上,而不是您的ssh客戶端電腦上將“UseDNS”設定為“no”。 (從您最初編寫問題的方式來看,聽起來您可能已經在客戶端上編輯了該文件,這不會產生任何影響。)

另一個解決方案是讓您的ISP(或負責您的公共可路由IP 位址的任何機構)在其DNS 名稱伺服器上修復您的IP 位址的反向DNS 記錄,這些伺服器對該區塊的反向DNS記錄具有權威性。換句話說,「讓人們可以根據您的 IP 位址找到您的主機名,並確保他們找到的主機名稱會對應回您的 IP 位址」。

答案2

有關此問題的更多資訊請參閱此處: https://github.com/Homebrew/homebrew-dupes/issues/242

顯然這是 Homebrew 目前版本的問題。 (我自己也剛剛遇到過。)

答案3

我認為 Homebrew 的 libssh2 搞亂了 Apple 的 ssh 二進位。嘗試:

brew uninstall --force libssh2. 

相關內容