{"meta":{"title":"错误：代理承认没有签署","intro":"在极少数情况下，通过 SSH 在 Linux 上连接到 GitHub 会产生错误 \"Agent admitted failure to sign using the key\"。 请遵循以下步骤解决此问题。","product":"身份验证","breadcrumbs":[{"href":"/zh/authentication","title":"身份验证"},{"href":"/zh/authentication/troubleshooting-ssh","title":"SSH 故障排除"},{"href":"/zh/authentication/troubleshooting-ssh/error-agent-admitted-failure-to-sign","title":"代理未能签署"}],"documentType":"article"},"body":"# 错误：代理承认没有签署\n\n在极少数情况下，通过 SSH 在 Linux 上连接到 GitHub 会产生错误 \"Agent admitted failure to sign using the key\"。 请遵循以下步骤解决此问题。\n\n在 Linux 上尝试将通过 SSH 连接到 GitHub.com 时，可能会在终端上看到以下信息：\n\n```shell\n$ ssh -vT git@github.com\n> ...\n> Agent admitted failure to sign using the key.\n> debug1: No more authentication methods to try.\n> Permission denied (publickey).\n```\n\n有关详细信息，请参阅 Canonical Launchpad 上的[此问题报告](https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/201786)。\n\n## 解决方法\n\n通过使用 `ssh-add` 将密钥加载到 SSH 代理，应该能够修复此错误：\n\n```shell\n# start the ssh-agent in the background\n$ eval \"$(ssh-agent -s)\"\n> Agent pid 59566\n$ ssh-add\n> Enter passphrase for /home/YOU/.ssh/id_rsa: [tippy tap]\n> Identity added: /home/YOU/.ssh/id_rsa (/home/YOU/.ssh/id_rsa)\n```\n\n如果密钥没有默认文件名 (`/.ssh/id_rsa`)，必须将该路径传递到 `ssh-add`：\n\n```shell\n# start the ssh-agent in the background\n$ eval \"$(ssh-agent -s)\"\n> Agent pid 59566\n$ ssh-add ~/.ssh/my_other_key\n> Enter passphrase for /home/YOU/.ssh/my_other_key: [tappity tap tap]\n> Identity added: /home/YOU/.ssh/my_other_key (/home/YOU/.ssh/my_other_key)\n```"}