如何查看 Git Bash 中使用了哪个 SSH 密钥文件?
我尝试了“git config --get-all”,但收到错误消息
错误:参数数量错误;用法: git config [选项]
使用哪个 SSH 密钥不是由 Git 决定的,而是由 SSH 客户端本身决定。在中配置适当的密钥~/.ssh/config
, or ssh
只是尝试连接到主机时可以找到的所有密钥。您可以通过使用标准 SSH 客户端连接到主机来查看哪个密钥最终成功。例如,使用 GitHub 时:
ssh -v [email protected] /cdn-cgi/l/email-protection
这会给你一些类似这样的东西:
[...]
debug1: Offering RSA public key: /home/me/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/me/.ssh/id_rsa2
debug1: Server accepts key: pkalg ssh-rsa blen ****
[...]
这告诉你关键.../id_rsa2
是服务器接受的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)