2016-08-24 21 views
1

我試圖ssh進入一個emr實例。 IP和密鑰信息是正確的。關於什麼問題的想法可能是?ssh進入emr實例失敗,ssh_exchange_identification錯誤


會話跟蹤:

> ssh -vv -i pemfile.pem [email protected] 
OpenSSH_6.9p1, LibreSSL 2.1.8 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 21: Applying options for * 
debug2: ssh_connect: needpriv 0 
debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22. 
debug1: Connection established. 
debug1: key_load_public: No such file or directory 
debug1: identity file pemfile.pem type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file pemfile.pem-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.9 
ssh_exchange_identification: Connection closed by remote host 

> ls -al pemfile.pem 
-rw-r--r-- 1 user staff 1692 Aug 24 15:09 pemfile.pem 
+0

什麼是用戶使用的是? – error2007s

+0

檢查 - 用戶信息是正確的(「hadoop @」) – blueberryfields

+0

我擔心「key_load_public:沒有這樣的文件或目錄」在ssh日誌中的錯誤 - 我的pem文件可能會損壞嗎? – blueberryfields

回答

1

這可以通過一些問題引起的,步驟,測試如下。

檢查的/etc/hosts.deny文件/etc/hosts.allow和

許多報道,這些配置將值正確幫助。但是,即使主機。*文件不是一個因素,我也看到了這個問題。

[email protected] # grep sshd /etc/hosts.allow 
sshd: ALL 

缺少依賴

這其中一個典型的glibc或OpenSSL的升級後發生的。許多發行版可以安裝更新到glibc或openssl庫,而不需要重新啓動sshd。

在任何發行版上,您可以在更新後識別它,然後使用lsof查看sshd打開文件的位置。有些將被指向DEL,因爲這些庫在更新時被刪除。

~ # lsof -n | grep ssh | grep DEL 

當SSH連接進來sshd守護進程叉,並嘗試連接(LD)這些LIB文件,並未能導致該錯誤。

損壞指紋/鍵

一些怎樣一個或另一個指紋或鑰匙已損壞(你手動編輯這些文件中的一個?)。刪除客戶端〜/ .ssh/known_hosts中的服務器端指紋,然後重試。重新連接時,系統會提示您再次接受主機身份。

如果您能夠以另一種方式訪問​​機器,您可能需要退出並重新創建服務器端〜/ .ssh/authorized_keys。

與此問題相同,如果文件/ etc/ssh/被刪除,並且sshd未重新啓動,則會顯示此錯誤。檢查sshd配置目錄中的密鑰文件。

重型服務器負載

也看到這種情況發生時,服務器是由例如,蠻力攻擊負載。增加sshd可以運行的連接數量。

[email protected] # grep MaxStartups /etc/ssh/sshd_config 
# Old Style 
MaxStartups 12 
# New Style 
MaxStartups 10:20:30 

參考:http://edoceo.com/notabene/ssh-exchange-identification

+0

請粘貼原始鏈接:http://edoceo.com/notabene/ssh-exchange-identification而不是複製粘貼內容。 – helloV

相關問題