V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
cevincheung
V2EX  ›  git

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

  •  
  •   cevincheung · 2016-10-15 21:28:09 +08:00 · 2113 次点击
    这是一个创建于 2747 天前的主题,其中的信息可能已经有所发展或是发生改变。

    /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
    
    leopku
        1
    leopku  
       2016-10-15 22:02:39 +08:00
    多私钥比较麻烦

    私钥用一个,公钥放不同平台的 deploy key 里
    Bardon
        2
    Bardon  
       2016-10-15 23:54:34 +08:00
    正确姿势,难道不是 ~/.ssh/config 中配置不同服务私钥的路径吗?
    cevincheung
        3
    cevincheung  
    OP
       2016-10-15 23:55:40 +08:00
    @Bardon 恩。晓得了已经解决了。突然间脑子不够用了。
    Delbert
        4
    Delbert  
       2016-10-16 07:22:20 +08:00 via Android
    创建 config 文件,在里面指定 host port 证书文件路径
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1051 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 1266ms · UTC 19:08 · PVG 03:08 · LAX 12:08 · JFK 15:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.