ssh で no kex alg 接続エラー

slogin xxx とすると

no kex alg

で、繋がらない。

◆古いCentOS→(Rocky9|Alma9|RHEL9)

サーバ側のログ

/var/log/secure
May 15 13:11:18 sv01 sshd[12223]: Unable to negotiate with xx.xx.xx.xx port 44073: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 [preauth]

 
SHA1系が使えなくなっているのでSHA1を有効にする
(セキュリティは弱くなるのでインターネット公開などの場合は非推奨)

update-crypto-policies --set DEFAULT:SHA1
再起動

 
update-crypto-policies (SHA1を有効)
 
 
 
◆古いCentOS→Ubuntu20.04

要求されるキー交換アルゴリズムが対応できていないのでSSHサーバ側で対処

/etc/ssh/sshd_config

KexAlgorithms +diffie-hellman-group14-sha1

とか

KexAlgorithms +diffie-hellman-group1-sha1

group14のほうが強度は高そう、「+」は追加する意味なので忘れないこと

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA