V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
cevincheung
V2EX  ›  git

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

  •  
  •   cevincheung · Oct 15, 2016 · 2540 views
    This topic created in 3481 days ago, the information mentioned may be changed or developed.

    /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  
       Oct 15, 2016
    多私钥比较麻烦

    私钥用一个,公钥放不同平台的 deploy key 里
    xmgit
        2
    xmgit  
       Oct 15, 2016
    正确姿势,难道不是 ~/.ssh/config 中配置不同服务私钥的路径吗?
    cevincheung
        3
    cevincheung  
    OP
       Oct 15, 2016
    @Bardon 恩。晓得了已经解决了。突然间脑子不够用了。
    Delbert
        4
    Delbert  
       Oct 16, 2016 via Android
    创建 config 文件,在里面指定 host port 证书文件路径
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3184 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 13:47 · PVG 21:47 · LAX 06:47 · JFK 09:47
    ♥ Do have faith in what you're doing.