SSH: Agent Admitted Failure To Sign Using The Key Error And Solution

The “agent admitted failure to sign using the key” error occurs when the ssh-agent is not able to use the private key to sign the SSH session. This can happen for several reasons:

  1. The ssh-agent is not running: You can start the ssh-agent by running the command eval "$(ssh-agent -s)".
  2. The private key is not added to the ssh-agent: You can add the private key by running the command ssh-add /path/to/privatekey.
  3. The private key is protected with a passphrase: If your private key is protected with a passphrase, the ssh-agent will prompt for the passphrase when you try to use it. Make sure you enter the correct passphrase.
  4. The permission of the private key is too open: Make sure the permission of the private key is set to 600 or less (-rw——-) .
  5. The ssh-agent is running but not available to the current shell session: You can fix this by adding the ssh-agent environment variables to your shell profile file.

You can check if ssh-agent is running by ssh-add -l, it should show the fingerprints of the keys.

You can also check the ssh-agent environment variables by running the command env | grep SSH_AUTH_SOCK.

You can check if the private key is present in ssh-agent by running the command ssh-add -L

You can check if the ssh-agent is running by running the command ps aux | grep ssh-agent.

If none of these solutions work, you may want to try generating a new key pair and adding the new public key to the remote server.

Leave a Comment