この記事について
CML2内に立てたubuntuサーバからCiscoノードに対してsshができなかった時の対処方法
$ ssh cisco@10.10.0.2
Unable to negotiate with 10.10.0.2 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
必要なSSH設定
- 原因は新しいサーバでは古い暗号化方式がデフォルトではサポートされなくなっている
- SSHクライアントにSSHサーバが使用している鍵交換方式と、共通鍵暗号化方式を設定
~/.ssh/config
Host 10.*
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1 # 鍵交換方式の指定
Ciphers aes128-ctr,aes192-ctr,aes256-ctr #共通鍵暗号化方式の指定
共通鍵暗号化方式はOSによってConfig内に記載あり。
共通鍵暗号方式がサーバの指定するものと一致しない場合、正しいパスワードを入力してもログイン不可。
iosvl2-0#sh run | i ssh
ip ssh version 2
ip ssh server algorithm encryption aes128-ctr aes192-ctr aes256-ctr
ip ssh client algorithm encryption aes128-ctr aes192-ctr aes256-ctr
以上