Debian 8 jessie, OpenSSH ssh connection server responded Algorithm negotiation failed,opensshresponded

來源:互聯網
上載者:User

Debian 8 jessie, OpenSSH ssh connection server responded Algorithm negotiation failed,opensshresponded

 

安裝了debian 8.5 就出問題了.

 

root@debian8:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.5 (jessie)
Release: 8.5
Codename: jessie
root@debian8:~# uname -a
Linux debian8 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
root@debian8:~#

ssh 串連失敗

 

參考了:

http://bbs.chinaunix.net/thread-4160457-2-1.html

這篇文章 還是不成功.

 

"

更新ssh到openssh-6.7p1.tar最新版,然後問題來了,ssh client連不上了,putty可以,SecureCRT 7.1可以 5.1又不行了,查了一下說加密協議不對,可是我不會,請教各位

白天圖掛了,手動上字

crt5.1 連提示: 到會話1.1.1.1 的串連失敗:
                金鑰交換失敗。
                沒有相容的加密程式。伺服器支援這些加密程式:
                aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-      

                gcm@openssh.com,chacha20-poly1305@openssh.com

ssh client 提示:Server responded"Algorithm negotiation failed"
                 Key exchange with the remote host failed. This can happen for
                 example computer does not support the selected algorthms. 

 

 

-------------------------------------------

 

問題已經解決了,修改ssh的設定檔 /etc/ssh/sshd_config

在設定檔中添加:

Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc

MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

重啟sshd服務後,即可正常串連。

ps:導致此問題的原因是ssh升級後,為了安全,預設不在採用原來一些密碼編譯演算法,我們手工添加進去即可。

 

"




後面繼續在 

root@debian8:~# cat /etc/ssh/sshd_config 

中尋找.

發現

預設

#PermitRootLogin without-password 不要求輸入密碼,改成要求輸入密碼

改成
PermitRootLogin yes

就能使用root登入 ,不然root會失敗.因為ssh 預設用的root使用者 .

如果使用其它使用者 則能成功登入 .

或者先用

putty 而不是用 SSH secure shell 去登入 .

也能成功.

 

還有就是在 

/etc/ssh/sshd_config  添加

Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

這個時由於不能複製,很容易寫錯.

正確步驟:

1,先用putty非root使用者 登入, 

2,nano  /etc/ssh/sshd_config 

copy 之前的 Ciphers ...文本..

3,重啟ssh服務

root@debian8:~# service ssh restart

4,查看ssh  是否啟動

root@debian8:~# ps aux | grep ssh
root 2640 0.0 1.2 95440 6244 ? Ss 00:26 0:01 sshd: root@pts/0
root 5321 0.0 1.3 95440 6520 ? Ss 00:37 0:00 sshd: root@pts/2
root 12265 0.0 1.2 95356 6476 ? Ss 00:45 0:00 sshd: root@pts/1
root 12283 0.0 0.3 12704 1976 ? Ss 00:50 0:00 /usr/lib/openssh/sftp-server
root 12307 0.0 1.0 55184 5428 ? Ss 00:56 0:00 /usr/sbin/sshd -D
root 12310 0.0 0.4 12728 2200 pts/1 S+ 00:56 0:00 grep ssh
root@debian8:~#

如果  /etc/ssh/sshd_config  寫錯了,ssh則不能啟動.

 

5,再看SSH secure shell能否串連.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.