# 错误：代理承认没有签署

在极少数情况下，通过 SSH 在 Linux 上连接到 GitHub 会产生错误 "Agent admitted failure to sign using the key"。 请遵循以下步骤解决此问题。

在 Linux 上尝试将通过 SSH 连接到 你的 GitHub Enterprise Server 实例 时，可能会在终端上看到以下信息：

```shell
$ ssh -vT git@HOSTNAME
> ...
> Agent admitted failure to sign using the key.
> debug1: No more authentication methods to try.
> Permission denied (publickey).
```

有关详细信息，请参阅 Canonical Launchpad 上的[此问题报告](https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/201786)。

## 解决方法

通过使用 `ssh-add` 将密钥加载到 SSH 代理，应该能够修复此错误：

```shell
# start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
> Agent pid 59566
$ ssh-add
> Enter passphrase for /home/YOU/.ssh/id_rsa: [tippy tap]
> Identity added: /home/YOU/.ssh/id_rsa (/home/YOU/.ssh/id_rsa)
```

如果密钥没有默认文件名 (`/.ssh/id_rsa`)，必须将该路径传递到 `ssh-add`：

```shell
# start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
> Agent pid 59566
$ ssh-add ~/.ssh/my_other_key
> Enter passphrase for /home/YOU/.ssh/my_other_key: [tappity tap tap]
> Identity added: /home/YOU/.ssh/my_other_key (/home/YOU/.ssh/my_other_key)
```