Skip to main content

Error: Agent admitted failure to sign

まれに、Linux 上の SSH 経由で GitHub に接続すると、エラー "Agent admitted failure to sign using the key" が発生します。 この問題を解決するには以下の手順に従ってください。

Linux コンピューターで GitHub.com に SSH 接続しようとすると、ターミナルに以下のメッセージが表示されることがあります。

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

詳細については、Canonical Launchpad のこの問題のレポートを参照してください。

解像度

ssh-add を使用してキーを SSH エージェントに読み込ませることでこのエラーを修正できます。

# 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 に渡す必要があります。

# 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)