V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
dingyaguang117
V2EX  ›  问与答

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

  •  
  •   dingyaguang117 · Mar 12, 2015 · 2632 views
    This topic created in 4073 days ago, the information mentioned may be changed or developed.

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

    5 replies    2015-03-13 10:25:00 +08:00
    ryd994
        1
    ryd994  
       Mar 12, 2015 via Android   ❤️ 1
    乖乖写config
    默认不应该是id_rsa么
    155
        2
    155  
       Mar 12, 2015   ❤️ 1
    默认是~/.ssh/id_dsa和~/.ssh/id_rsa, 可以通过~/.ssh/config指定.
    hisway
        3
    hisway  
       Mar 12, 2015
    # vi ~/ssh/sshd_config
    AuthorizedKeysFile .ssh/authorized_keys
    #验证文件路径
    mN71eOOprFyMsnPx
        4
    mN71eOOprFyMsnPx  
       Mar 12, 2015
    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  
       Mar 13, 2015
    @hisway 你说的那是sshd端
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5772 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 74ms · UTC 06:45 · PVG 14:45 · LAX 23:45 · JFK 02:45
    ♥ Do have faith in what you're doing.