我想通过git将一些源代码克隆到我的服务器上,因此:
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密钥文件?它在哪里?
这意味着他们是完全不同的文件!
发布于 2013-09-16 07:42:07
您确定要继续连接(是/否)吗?不是
您应该回答“是”(这将将主机添加到您的~/.ssh/known_hosts文件中)。
这与你的ssh公钥无关。
--这不是您的“使用不同文件的git”。
这是您的ssh会话,要求您确认您知道这个远程主机。
然后ssh将使用您的公钥。
一个简单的ssh -T git@git.cloudbees.com将触发相同的消息(至少在您接受该主机之前)。
(或ssh-keyscan)
https://stackoverflow.com/questions/18822488
复制相似问题