Debian8 SSH登录失败:密钥交换失败

发行版及版本号:

debian:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.6 (jessie)
Release:        8.6
Codename:       jessie

通过 apt-get install -y openssh-server 命令安装了sshd,并修改配置文件使root用户可以通过密码登录

debian:~# sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
debian:~# systemctl restart ssh.service

使用SecureCRT 7.x可以登录,但是ssh secure shell client不能登录,提示如下:

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.

通过网络搜索得知,openssh升级后,删除了一些旧的加密算法,所有导致部分ssh clients不能登录。根据网友的分享,我将这些加密算法添加到sshd_config,然后重启启动sshd。

debian:~# cat << EOF >>/etc/ssh/sshd_config
# there are old encryption algorithms
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,ecdg
EOF
debian:~# systemctl restart ssh.service

然后检查ssh secure shell client,已经成功登录了。

    原文作者:岳阳小罗
    原文地址: https://www.jianshu.com/p/b892760e519a
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞