1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ssh接続時に鍵交換アルゴリズムのネゴシエーションに失敗したときの対処法

1
Last updated at Posted at 2024-02-20

本記事の対象となるエラー

検証環境のNW機器にSSHログインを試行したところ、クライアント側で以下のエラーが出力された。

# ssh xxxx@x.x.x.x
Unable to negotiate with x.x.x.x port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

SSHサーバとなるNW機器が古い鍵交換アルゴリズムにしか対応しておらず、接続に失敗していることがわかる。

解決

-o オプションで鍵交換アルゴリズムを追加してやることで解決した。

# ssh -o KexAlgorithms=+diffie-hellman-group-exchange-sha1 xxxx@x.x.x.x

configファイルを作成している場合は以下のように記載する。

~/.ssh/config
HOST hoge
HOSTNAME x.x.x.x
USER hoge
KexAlgorithms diffie-hellman-group-exchange-sha1

注意点

今回は個人的な検証環境なので問題なかったが、セキュリティ的によろしくはない。

1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?