V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
dingyaguang117
V2EX  ›  问与答

当.ssh 下出现多对公私钥对的时候,默认使用的哪个一个?

  •  
  •   dingyaguang117 · 2015-03-12 14:32:30 +08:00 · 2248 次点击
    这是一个创建于 3384 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在做免密码登陆,以及Git的时候怎么选

    5 条回复    2015-03-13 10:25:00 +08:00
    ryd994
        1
    ryd994  
       2015-03-12 14:37:44 +08:00 via Android   ❤️ 1
    乖乖写config
    默认不应该是id_rsa么
    155
        2
    155  
       2015-03-12 14:38:10 +08:00   ❤️ 1
    默认是~/.ssh/id_dsa和~/.ssh/id_rsa, 可以通过~/.ssh/config指定.
    hisway
        3
    hisway  
       2015-03-12 16:21:53 +08:00
    # vi ~/ssh/sshd_config
    AuthorizedKeysFile .ssh/authorized_keys
    #验证文件路径
    FifiLyu
        4
    FifiLyu  
       2015-03-12 17:53:15 +08:00
    cat ~/.ssh/config

    # 未指定Host的私钥必须在顶部
    IdentityFile ~/.ssh/111111111111.key
    IdentityFile ~/.ssh/222222222222.key


    Host git.oschina.net
    IdentityFile ~/.ssh/git.oschina.net.3333333.key

    Host github.com
    IdentityFile ~/.ssh/github.com.444444444.key
    julyclyde
        5
    julyclyde  
       2015-03-13 10:25:00 +08:00
    @hisway 你说的那是sshd端
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2756 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:53 · PVG 21:53 · LAX 06:53 · JFK 09:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.