SourcetreeでSSHの障害

Table of Contents

Windows11のパソコンで、Sourcetreeを新規インストールして、プルを実行しても下記のエラーが表示されて、障害が発生。

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch --no-tags origin
The host key is not cached for this server:
  ns.chinaz.org (port 22)
You have no guarantee that the server is the computer
you think it is.
The server's ssh-ed25519 key fingerprint is:
  ssh-ed25519 255 SHA256:xxxxxxxxxxxxxxx
If you trust this host, enter "y" to add the key to

エラー終了しました。エラーの内容は上記をご覧ください。
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n, Return cancels connection, i for more info) fatal: Could not read from remote repository.

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

エラー終了しました。エラーの内容は上記をご覧ください。

下記の操作を行ったが改善せず。

  • 旧環境からフォルダことコピーしてプル
  • クローンの作成
  • Sourcetreeの内臓Gitの更新
  • Sourcetreeのターミナルで、「git -c diff.mnemonicprefix=false -c core.quotepath=false –no-optional-locks fetch –no-tags origin」を実行して、「known_hosts」を作成

原因

下記のレジストリ情報が作成されていないことが原因、正常に稼働するPCでは作成されている。

HKEY_CURRENT_USER\SoftWare\SimonTatham\PuTTY\SshHostKeys

対処

Sourcetreeに付属のplink.exeを実行することで復旧

コマンドプロンプトで
cd C:\Users\hoge\AppData\Local\SourceTree\app-3.4.11\tools\putty\plink.exe -ssh -C -i privatekey.ppk hoge@ns.chinaz.org

参考URL

WindowsのSourceTreeでBitbucketからクローンできなかった – Qiita
Trust A Server’s Host Key when No Button is Available to Trust It | Sourcetree | Atlassian Documentation

SourcetreeでSSHの障害」への1件のフィードバック

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です