关于 GIT 怎么设置多个不同的部署公钥?

2016-10-15 21:28:09 +08:00
 cevincheung

/home/www/.ssh/id_rsa中有两个部署公钥

---begin---
github
--end--
---begin--
git.oschina.net
---end--

使用 clone 从 github 上没问题,换到 其他公钥(平台)就不行了。提示错误如下:

RSA key fingerprint is 98:ab:2b:30:60:00:82:86:bb:85:db:87:22:c4:4f:b1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '101.70.156.64' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
2116 次点击
所在节点    git
4 条回复
leopku
2016-10-15 22:02:39 +08:00
多私钥比较麻烦

私钥用一个,公钥放不同平台的 deploy key 里
Bardon
2016-10-15 23:54:34 +08:00
正确姿势,难道不是 ~/.ssh/config 中配置不同服务私钥的路径吗?
cevincheung
2016-10-15 23:55:40 +08:00
@Bardon 恩。晓得了已经解决了。突然间脑子不够用了。
Delbert
2016-10-16 07:22:20 +08:00
创建 config 文件,在里面指定 host port 证书文件路径

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/313047

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX