bash - 如何将已生成的 SSH 密钥添加到 git bash?
问题描述
我有一个 SSH 密钥保存在D:/keys folder
. 我想将它添加到我的 git bash 中。我找到的所有教程都是如何使用 gitbash 生成 SSH 密钥并将其加载到 github/gitlab。我使用 puttygen 生成了我的 SSH 密钥。现在我想将它添加到我的 git bash 中,以便我可以从远程克隆存储库。我怎样才能做到这一点?
解决方案
在 Windows 上,您可能需要像这样启动 ssh 代理
# start the ssh-agent in the background
$ eval $(ssh-agent -s)
> Agent pid 59566
将您的 SSH 私钥添加到 ssh-agent。如果您使用不同的名称创建了密钥,或者如果您要添加具有不同名称的现有密钥,请将命令中的 id_rsa 替换为您的私钥文件的名称。
$ ssh-add <path/to/key>
在“将您的 SSH 密钥添加到 ssh-agent”下从此处获取此信息: https ://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to- the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent
推荐阅读
- pdf - 使用 mojolicious 生成 PDF
- swift - 在一个或两个表已经保存后,如何加快表之间的关系更新?
- reactjs - 将 async await 与 redux reducer 一起使用
- barcode - Zbar Code128 解码错误
- zapier - zapier 以编程方式设置捆绑包输入数据
- kubernetes - Pod 无法通过服务 IP 连接到自身(kubernetes v1.10)
- java - 由 java.lang.IllegalArgumentException 引起:MediaButtonReceiver 组件可能不为空
- r - R中的条件交叉表
- gradle - gradle - configure() 方法有什么作用
- django - 发布请求在 ListView 内的 get_queryset 函数内不可用