如何查看git bash中使用的ssh密钥文件.我试过"git config --get-all",但是我收到错误消息"错误:参数数量错误;用法:git config [options]"
Jan*_*ger 77
使用哪个SSH密钥不是由git决定的,而是由SSH客户端本身决定的.可以配置相应的密钥~/.ssh/config,也ssh可以尝试连接到主机时可以找到的所有密钥.您可以通过使用标准SSH客户端连接到主机来查看最终成功的密钥.例如,使用Github时:
ssh -v git@github.com
这会给你一些像这样的东西:
[...]
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是服务器接受的密钥.
Mew*_*ewX 38
另一个解决方案,在最新的git bash中,你可以输入:
$ git-gui
然后执行GUI应用程序,在GUI中,您只需单击__CODE__以显示SSH密钥.
小智 9
这个命令对我有用:
cat ~/.ssh/id_rsa.pub
| 归档时间: | 
 | 
| 查看次数: | 70140 次 | 
| 最近记录: |