Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GITEE_RSA_PRIVATE_KEY的问题 #29

Closed
HuBoZhi opened this issue Jan 24, 2021 · 6 comments
Closed

GITEE_RSA_PRIVATE_KEY的问题 #29

HuBoZhi opened this issue Jan 24, 2021 · 6 comments

Comments

@HuBoZhi
Copy link

HuBoZhi commented Jan 24, 2021

Cloning into bare repository 'MarkdownBook.git'...
SOURCE=git@github.com:HuBoZhi/MarkdownBook.git
DESTINATION=git@gitee.com:hubozhi/markdown-book.git
Warning: Permanently added 'github.com,140.82.113.3' (RSA) to the list of known hosts.
Load key "/root/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

这个GITEE_RSA_PRIVATE_KEY是公钥还是私钥,这个是怎么生成的,为什么我看到还有人放在了另一个配置里面。
教程可否在详细一些。感谢大佬回答,知识量太少看不懂你这个教程。

@yanglbme
Copy link
Owner

回答两个问题:

  1. PRIVATE 表示私有的,说明这是一个私钥。私钥配置在 GitHub,而公钥配置在 Gitee。

这就相当于,你在本地电脑上保存了私钥,公钥放在 Gitee 上,然后你在本地提交代码到了 Gitee。

只不过你现在的代码是在 GitHub 上,依靠 GitHub 帮你自动同步最新的代码到 Gitee 而已。

  1. 密钥的生成
ssh-keygen -t rsa

@yanglbme
Copy link
Owner

@HuBoZhi
Copy link
Author

HuBoZhi commented Jan 24, 2021

感谢,我继续研究一下

@yanglbme
Copy link
Owner

image

我的公钥是放在这里。

@yanglbme
Copy link
Owner

我在 README 中更新了公私钥的完整配置步骤,你可以参考一下 @HuBoZhi

@HuBoZhi
Copy link
Author

HuBoZhi commented Jan 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants