将 rsa 密钥添加到系统
Add rsa-keys to the system
有人将 rsa 密钥以 zip 形式发送给我,使用这些 ssh 密钥然后我应该能够克隆一个 bitbucket 存储库。没错,他给我发了一个包含 2 个文件的 zip:
- 关键
- key.rsa
那么,我应该如何处理这些文件呢?我在 ubuntu,但我不知道如何处理这些文件才能获准下载存储库
您不仅必须将它们复制到您的 ~/.ssh 文件夹中,而且您需要确保:
它们的命名正确:
id_rsa (for the bigger of the two files)
id_rsa.pub (for the smaller)
他们得到了正确的保护
chmod 600 id_rsa*
那你can copy id_rsa.pub
(make sure it is in one line) in your BitBucket account, ssh keys section.
最后你可以测试它是否适用于
ssh -Tv git@bitbucket.org
最后,您应该看到:
logged in as <yourBitBucketAccount>.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
这意味着您已通过适当的身份验证,并且能够像您自己一样推送回 Bitbucket。
如果您没有看到,前面几行允许您仔细检查 ssh 考虑了哪些文件。
有人将 rsa 密钥以 zip 形式发送给我,使用这些 ssh 密钥然后我应该能够克隆一个 bitbucket 存储库。没错,他给我发了一个包含 2 个文件的 zip:
- 关键
- key.rsa
那么,我应该如何处理这些文件呢?我在 ubuntu,但我不知道如何处理这些文件才能获准下载存储库
您不仅必须将它们复制到您的 ~/.ssh 文件夹中,而且您需要确保:
它们的命名正确:
id_rsa (for the bigger of the two files) id_rsa.pub (for the smaller)
他们得到了正确的保护
chmod 600 id_rsa*
那你can copy id_rsa.pub
(make sure it is in one line) in your BitBucket account, ssh keys section.
最后你可以测试它是否适用于
ssh -Tv git@bitbucket.org
最后,您应该看到:
logged in as <yourBitBucketAccount>.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
这意味着您已通过适当的身份验证,并且能够像您自己一样推送回 Bitbucket。
如果您没有看到,前面几行允许您仔细检查 ssh 考虑了哪些文件。