【发布时间】: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 但是生成的公钥在评论中不会有用户邮箱吧?