Git and SSH, which key is used?

后端 未结 7 2081
暗喜
暗喜 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:32

    On the remote server, edit the sshd_config file and change LogLevel from INFO to VERBOSE and restart ssh.

    Now your log file will hold the fingerprint of the key that was used to authenticate each user.

    On Ubuntu, these files are:

    /etc/ssh/sshd_config
    /var/log/auth.log
    

    but they may be different on another distro. Just google for their location (some use /var/log/secure for example).

提交回复
热议问题