Unable to negotiate with XX.XXX.XX.XX: no matching host key type found. Their offer: ssh-dss Ask Question

Unable to negotiate with XX.XXX.XX.XX: no matching host key type found. Their offer: ssh-dss Ask Question

I am trying to create a git repository on my web host and clone it on my computer. Here's what I did:

  1. I created a repository on the remote server.
  2. I generated a key pair: ssh-keygen -t dsa.
  3. I added my key to ssh-agent.
  4. I copied to the server public key in ~/.ssh.

And then, after an attempt to run the command git clone ssh://user@host/path-to-repository, I get an error:

XX.XXX.XX.XX とネゴシエートできません: 一致するホスト キー タイプが見つかりません。提供内容: ssh-dss
致命的: リモート リポジトリから読み取れませんでした。
適切なアクセス権があり、リポジトリが存在することを確認してください。

それはどういう意味ですか?

ベストアンサー1

最近の openssh バージョンでは、デフォルトで DSA キーが非推奨になりました。GIT プロバイダーに適切なホスト キーを追加するよう提案する必要があります。DSA のみに頼るのは得策ではありません。

ssh回避策としては、クライアントにDSAホストキーを受け入れるように伝える必要があります。従来の使用方法に関する公式ドキュメント可能性は少ないですが、~/.ssh/configファイルに次の行を追加することをお勧めします。

Host your-remote-host
    HostkeyAlgorithms +ssh-dss

他の方法としては、環境変数を使用してGIT_SSHこれらのオプションを指定することです。

GIT_SSH_COMMAND="ssh -oHostKeyAlgorithms=+ssh-dss" git clone ssh://user@host/path-to-repository

おすすめ記事