更新:

Received disconnect from … : Too many authentication failures の解決案


問題

SSHで認証用の証明書を使ってサーバーに接続しようとする場合、以下のエラーが表示されます。

Received disconnect from 52.196.174.79 port 22:2: Too many authentication failuresDisconnected from 52.196.174.79 port 22

認証用の証明書を使って接続する場合、以下の解決案があります。

解決

IdentitiesOnly=yesを指定すると解決できます。

SSHのコマンドを使う場合

ssh -o IdentitiesOnly=yes <serverName>

SSHの .config 設定ファイルを使う場合

Host myServer     User ec2-user     Hostname ...     IdentityFile ~/certificate.pem     IdentitiesOnly=yes