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.在界面上使用命令行模式推送代码。如下: file 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

我的博客园:https://www.cnblogs.com/swx123 我的github(代码一般都放在这里):https://github.com/578223592

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值