【发布时间】:2021-08-29 06:18:19
【问题描述】:
我创建了一个SSH 密钥(在 PC A 上)来访问我的 GitHub 存储库(正常工作)。然后我将此密钥复制到 PC B。由于某种原因,即使公钥和私钥相同,我也无法从 PC B 访问 repo。
Cloning into 'repo'...
sign_and_send_pubkey: signing failed for RSA "/home/milano/.ssh/github-futilestudio" from agent: agent refused operation
sign_and_send_pubkey: signing failed for RSA "milano@milano-lenovo" from agent: agent refused operation
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
这背后的原因是什么?
编辑
原因可能是 SSH 密钥末尾的签名吗?
milano@milano-lenovo
这显然是PC A的名字。
【问题讨论】:
-
调试 ssh 问题:运行
ssh -v [user]@[target host](例如:ssh -v git@github.com) -
这个错误的关键是文本
agent refused operation。这有多种可能的原因;有关详细信息,请参阅stackoverflow.com/q/44250002/1256452。请注意,正如VonC suggests 一样,使用单独的键 通常是一个更好的主意。您应该考虑您的实际情况以及单独或共享密钥的安全隐患。