I am trying to create a git repository on my web host and clone it on my computer. Here's what I did:
- I created a repository on the remote server.
- I generated a key pair:
ssh-keygen -t dsa
. - I added my key to ssh-agent.
- 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