SourceTree SSH第一次登录需要交互确认的问题

问题

在SourceTree SSH配置完ssh之后向上提交代码的时候发现:

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 **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
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)

问题是没法按y。这样的话就一直没法提交代码了。

解决方案

一共有两种解决方案
1.在界面上使用命令行模式推送代码。如下:

2.初始化putty。因为source Tree好像是使用putty作为秘钥验证的工具。具体做法为:

  • 找到putty路径,默认在: SourceTree\app-3.4.12\tools\putty,进入这个路径
  • 在此处打开命令行,运行:plink git@github.com即可。
PS C:\Users\Administrator\AppData\Local\SourceTree\app-3.4.16\tools\putty> ./plink git@github.com
The host key is not cached for this server:
  github.com (port 22)
You have no guarantee that the server is the computer
you think it is.
The server's ssh-ed25519 key fingerprint is:
  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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) y
Using username "git".
Access granted. Press Return to begin session.
Server refused to allocate pty
Hi 578223592

posted @   思wu邪  阅读(724)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
点击右上角即可分享
微信分享提示