PuTTY 致命错误:无法就主机密钥算法达成一致

a c*_*der 11 linux putty

我正在尝试使用 PuTTY 连接到新系统,并看到以下内容:

致命错误:无法就主机密钥算法达成一致(可用:rsa-sha2-512、rsa-sha2-256、ecdsa-sha2-nistp256)

腻子致命错误

检查服务器上可用的算法:

acoder@client ~ $ nmap --script ssh2-enum-algos -sV -p 22 server.name.here

Starting Nmap 7.01 ( https://nmap.org ) at 2021-04-16 10:33 EDT
Nmap scan report for server.name.here (1.1.1.1)
Host is up (0.018s latency).
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.0 (protocol 2.0)
| ssh2-enum-algos: 
|   kex_algorithms: (7)
|       ecdh-sha2-nistp256
|       ecdh-sha2-nistp384
|       ecdh-sha2-nistp521
|       diffie-hellman-group-exchange-sha256
|       diffie-hellman-group14-sha256
|       diffie-hellman-group16-sha512
|       diffie-hellman-group18-sha512
|   server_host_key_algorithms: (3)
|       rsa-sha2-512
|       rsa-sha2-256
|       ecdsa-sha2-nistp256
|   encryption_algorithms: (6)
|       aes256-gcm@openssh.com
|       aes256-ctr
|       aes256-cbc
|       aes128-gcm@openssh.com
|       aes128-ctr
|       aes128-cbc
|   mac_algorithms: (6)
|       hmac-sha2-256-etm@openssh.com
|       hmac-sha1-etm@openssh.com
|       hmac-sha2-512-etm@openssh.com
|       hmac-sha2-256
|       hmac-sha1
|       hmac-sha2-512
|   compression_algorithms: (2)
|       none
|_      zlib@openssh.com
Run Code Online (Sandbox Code Playgroud)

以下是我的客户端计算机上可用的内容:

公钥接受的密钥类型

acoder@client ~ $ ssh -Q key
ssh-ed25519
ssh-ed25519-cert-v01@openssh.com
ssh-rsa
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
ssh-rsa-cert-v01@openssh.com
ssh-dss-cert-v01@openssh.com
ecdsa-sha2-nistp256-cert-v01@openssh.com
ecdsa-sha2-nistp384-cert-v01@openssh.com
ecdsa-sha2-nistp521-cert-v01@openssh.com
Run Code Online (Sandbox Code Playgroud)

密码

acoder@client ~ $ ssh -Q cipher
3des-cbc
blowfish-cbc
cast128-cbc
arcfour
arcfour128
arcfour256
aes128-cbc
aes192-cbc
aes256-cbc
rijndael-cbc@lysator.liu.se
aes128-ctr
aes192-ctr
aes256-ctr
aes128-gcm@openssh.com
aes256-gcm@openssh.com
chacha20-poly1305@openssh.com
Run Code Online (Sandbox Code Playgroud)

MAC

acoder@client ~ $ ssh -Q mac
hmac-sha1
hmac-sha1-96
hmac-sha2-256
hmac-sha2-512
hmac-md5
hmac-md5-96
hmac-ripemd160
hmac-ripemd160@openssh.com
umac-64@openssh.com
umac-128@openssh.com
hmac-sha1-etm@openssh.com
hmac-sha1-96-etm@openssh.com
hmac-sha2-256-etm@openssh.com
hmac-sha2-512-etm@openssh.com
hmac-md5-etm@openssh.com
hmac-md5-96-etm@openssh.com
hmac-ripemd160-etm@openssh.com
umac-64-etm@openssh.com
umac-128-etm@openssh.com
Run Code Online (Sandbox Code Playgroud)

Kex算法

acoder@client ~ $ ssh -Q kex
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
curve25519-sha256@libssh.org
Run Code Online (Sandbox Code Playgroud)

我在这里忽略了什么?

use*_*686 14

您忽略了 PuTTY 和 ssh (OpenSSH) 是两个完全独立的程序。他们不共享任何代码;他们不使用任何常见的加密库。这些ssh -Q列表不会告诉您有关 PuTTY 可以支持的内容的任何信息。

我认为问题是你的 PuTTY 版本太旧了。在服务器提供的签名方法中,ECDSA 签名 ( ecdsa-sha2-nistp256) 至少需要 PuTTY 0.68版本,而 RSA-SHA2 方法 ( rsa-sha2-*) 仅在下一个 PuTTY 版本 (0.75) 中可用。

原因是 OpenSSH 服务器ssh-rsa最近禁用了对旧的基于 SHA1 的签名算法的支持(它们仍然使用相同的 RSA 密钥,但只能通过基于 SHA2 的签名),而对 DSA 密钥的支持几年前已被删除。