【问题标题】:How to identify github user with ssh key?如何使用 ssh 密钥识别 github 用户?
【发布时间】:2022-04-26 20:38:59
【问题描述】:

我想禁用一个有效的 git ssh 密钥。但不知道 ssh 密钥的所有者。 对于禁用密钥或删除用户,我需要知道用户详细信息。

文件:.git/config不包含用户信息。

当我尝试提交时遇到以下错误

*** Please tell me who you are.

Run 

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

仅供参考:密钥已获得 SAML 授权。

我能知道是否有一种方法可以使用 ssh 密钥找到 git 用户吗?

【问题讨论】:

  • 您可以检查authorized_keys,然后通常在评论部分查看公钥,您应该会看到用户或机器<algorithm> <key> <comment>
  • 很遗憾,机器只有一个私钥,在机器内部没有找到公钥。
  • 可以使用任何用户提交,SSH密钥用于推送。
  • 您可以将私钥转换为公钥:stackoverflow.com/a/38290956/7976758
  • @phd 但是生成的公钥在评论中不会有用户邮箱吧?

标签: github ssh-keys


【解决方案1】:

您可以使用该公钥连接到 Github

ssh -T git@github.com

返回:

Hi githubUser! You've successfully authenticated, but GitHub does not provide shell access.

【讨论】:

    猜你喜欢
    • 2022-01-14
    • 2012-03-22
    • 2015-10-22
    • 2018-03-17
    • 1970-01-01
    • 2015-05-15
    • 2012-06-19
    • 1970-01-01
    • 2022-01-19
    相关资源
    最近更新 更多