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 3 years have passed since last update.

SourcetreeでGithubのリポジトリをクローンする際にエラーが出た

1
Posted at

macでは遭遇しなかったのでWindows特有の問題かも

エラー文

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
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)

対処方法

コマンドプロンプトで以下を実行

"C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe" -ssh -C -i "path\to\private\key.ppk" git@github.com

plink.exeとssh接続に使用する秘密鍵へのパスは各環境によって異なるため注意

C:\Users\tenryu>"plink.exeへのパス" -ssh -C -i "秘密鍵へのパス" git@github.com
Using username "git".
Access granted. Press Return to begin session.
Server refused to allocate pty
Hi ユーザー名! You've successfully authenticated, but GitHub does not provide shell access.

これが出ればOK

しかしこの後もSourcetree上でssh認証の失敗エラーが出る
画面右下にあるアイコンからsshキーagentを起動し、生成した秘密鍵を選択するとエラーは解消された

image.png

image.png

参考

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?