LoginSignup
5
0

More than 1 year has passed since last update.

MACでSSH接続時にno matching key exchange method foundで怒られた場合の対応方法

Last updated at Posted at 2022-03-04

概要

SSH接続時に「鍵交換方式が見つからないですよ」と怒られたので対応方法をまとめる

参考にしたサイト

 no matching key exchange method found. 
 Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

.ssh/configに鍵交換方式を設定する

# 接続先名
HOST xxx.xxx.xxx.xx 

# 鍵交換アルゴリズムを追加で指定
+KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

# 以下だと指定した3つの鍵交換アルゴリズムのみに限定されてしまう
# KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

# 実際の通信を暗号化する暗号化アルゴリズムを指定
Ciphers aes128-cbc

再度SSH接続を実行する

パスワードを聞かれるようになれば成功です

ssh xxxx@xxx.xxx.xxx.xx
xxxx@xxx.xxx.xxx.xx's password:
5
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0