歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> Debian 8 jessie, OpenSSH ssh connection server responded Algorithm negotiation failed,opensshresponded

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

日期:2017/3/6 9:26:06   编辑:學習Linux

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


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,[email protected],aes256-

[email protected],[email protected]

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,[email protected],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,[email protected]

重啟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,[email protected],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,[email protected]

這個時由於不能復制,很容易寫錯.

正確步驟:

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能否連接.

http://xxxxxx/Linuxjc/1146755.html TechArticle

Copyright © Linux教程網 All Rights Reserved