@peccul is peccu

(love peccu '(emacs lisp cat outdoor bicycle mac linux coffee))

ssh-agentに鍵をたくさん登録するとsshでの接続に失敗するので~/.ssh/configで回避した(Too many authentication failures for)

ssh-agent(秘密鍵を覚えてくれるツール)に複数のカギを登録していると、 ssh接続時に下記のエラーが表示され失敗した。

Too many authentication failures for

これは、鍵を指定しているにもかかわらず、ssh-agentに保存された鍵をすべて試すため、 目的の鍵に到達するまですべて認証に失敗することが原因とのこと。

指定した鍵のみで認証するにはsshコマンドに下記のオプションを追加するか、

-o 'IdentitiesOnly yes' 

~/.ssh/configに下記の設定を追加する必要があった。

Host hoge
    ...
    ...
    IdentitiesOnly yes

superuser.com