Git and SSH, which key is used?

后端 未结 7 1934
暗喜
暗喜 2021-01-29 23:57

Say your .ssh directory contains 30 keys (15 private and 15 public).

Where in Git can one check which one is used to connect to a given remote repository?

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-30 00:18

    Since git just uses ssh to connect, it will use whichever key ssh would use to connect to the remote host. See the ~/.ssh/config file for details; the host block uses the IdentityFile directive to specify the private key to use. The ssh_config(5) manpage contains full details.

提交回复
热议问题