LoginSignup
4
3

More than 1 year has passed since last update.

Windows 11 で ssh を使って git clone できなくなった

Posted at

問題点

Windows 11 で開発環境を整える際、ssh で git clone しようとしたが、下記エラーが出て取得できなかった。

powershell
Cloning into 'hoge'...
Unable to negotiate with 192.168.***.*** port *****: no matching host key type found. Their offer: ssh-rsa,ssh-dss
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

発生条件

  1. Git バージョンは 2.34.1
  2. Windows 10 では問題なく動作する
  3. Git GUI の help から生成したキーを使用した。(RSA)
  4. Git サーバーに ssh 接続はできた。

解決方法

下記サイトを参考にして、~/.ssh/config に設定を追加した。(無ければ作成する)
環境は違うが、どうやら ssh クライアントがバージョンアップしたことが原因のようだ。
Security Log - OSをアップデートしたらDSAのssh-keyが使えなくなってしまった人へ

config
Host *
        HostKeyAlgorithms +ssh-rsa
        PubkeyAcceptedKeyTypes +ssh-rsa
4
3
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
4
3