首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >[Ubuntu13.04]为什么我的git使用不同的密钥文件?

[Ubuntu13.04]为什么我的git使用不同的密钥文件?
EN

Stack Overflow用户
提问于 2013-09-16 07:27:09
回答 1查看 238关注 0票数 1

我想通过git将一些源代码克隆到我的服务器上,因此:

代码语言:javascript
复制
root@wemet:~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
79:ff:5d:07:9f:64:a7:d2:3f:81:0c:4d:ac:54:4e:fe root@wemet
The key's randomart image is:
+--[ RSA 2048]----+
| oo |
| .+o |
| . +o |
| . o .. |
| S . o oE.|
| . . +o=o|
| o o.=|
| o +o|
| . +|
+-----------------+
root@wemet:~# git clone ssh://git@git.cloudbees.com/foretribe/wetest.git
Cloning into 'wetest'...
The authenticity of host 'git.cloudbees.com (54.235.125.211)' can't be establis
ed.
ECDSA key fingerprint is 39:fe:eb:80:cd:56:bb:42:0e:bc:77:85:2c:9b:14:d2.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
root@wemet:~# 

您可以看到ssh-keygen使用指纹79:ff:5d:07:9f:64:a7:d2:3f:81:0c:4d:ac:54:4e:fe生成文件,但是当我想应用git命令时,文件指纹是: 39:fe:eb:80:cd:56:bb:42:0e:bc:77:85:2c:9b:14:d2。

git命令应该检索它应该存储在/root/. ssh /为什么ssh获得其他文件的默认ssh密钥文件?它在哪里?

这意味着他们是完全不同的文件!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-09-16 07:42:07

您确定要继续连接(是/否)吗?不是

您应该回答“是”(这将将主机添加到您的~/.ssh/known_hosts文件中)。

这与你的ssh公钥无关。

--这不是您的“使用不同文件的git”。

这是您的ssh会话,要求您确认您知道这个远程主机。

然后ssh将使用您的公钥。

一个简单的ssh -T git@git.cloudbees.com将触发相同的消息(至少在您接受该主机之前)。

(或ssh-keyscan)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18822488

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档