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)
| [email protected]
| aes256-ctr
| aes256-cbc
| [email protected]
| aes128-ctr
| aes128-cbc
| mac_algorithms: (6)
| [email protected]
| [email protected]
| [email protected]
| hmac-sha2-256
| hmac-sha1
| hmac-sha2-512
| compression_algorithms: (2)
| none
|_ [email protected]
私のクライアント マシンで利用可能なものは次のとおりです。
公開鍵承認キータイプ
acoder@client ~ $ ssh -Q key
ssh-ed25519
[email protected]
ssh-rsa
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
暗号
acoder@client ~ $ ssh -Q cipher
3des-cbc
blowfish-cbc
cast128-cbc
arcfour
arcfour128
arcfour256
aes128-cbc
aes192-cbc
aes256-cbc
[email protected]
aes128-ctr
aes192-ctr
aes256-ctr
[email protected]
[email protected]
[email protected]
MAC
acoder@client ~ $ ssh -Q mac
hmac-sha1
hmac-sha1-96
hmac-sha2-256
hmac-sha2-512
hmac-md5
hmac-md5-96
hmac-ripemd160
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
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
[email protected]
ここで何を見落としているのでしょうか?
答え1
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 キーのサポートは数年前に削除されたことです。