Signing Failed: Agent Refused Operation [SOLVED]

While attempting to connect to some server over SSH, you may get the error as follows:

sign_and_send_pubkey: signing failed for RSA “/home/<username>/.ssh/id_rsa” from agent: agent refused operation

The “agent refused operation” error is usually caused by too open permissions on a private key file.

In this short note i am showing how to fix this error.

Signing Failed: Agent Refused Operation

Run ssh-add command on the client machine to add the SSH key to the agent:

$ ssh-add

To force the SSH key to be kept permanently, add it to your ~/.ssh/config file:

Host *
  IdentityFile /home/<username>/.ssh/id_rsa

If ssh-add causes the message as follows, it means it is required to set more restrictive permissions on the private key file:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0744 for '/home/<username>/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

To set the proper permissions, execute:

$ chmod 600 /home/<username>/.ssh/id_rsa

Once the permissions are fixed, the “signing failed: agent refused operation” issue should be solved and you should be able to SSH normally.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Start a GUI Application on a Remote Computer using SSH

This article describes how to log into the remote computer (server) using SSH and run a GUI...

SSH Login Slow — Removing Delay

Problem: When I’m trying to log into the remote server via SSH, after I enter the UserName, it...

SSHPass: SSH Login With Password – Command Line

A password-based authentication is often a default way to connect to a remote host over SSH. But...

SSH Fingerprint: Get Fingerprint of SSH RSA Key

The fingerprint is a unique sequence of letters and numbers used to identify the SSH RSA key. It...

SSH: Create Public Key from Private

Usually a public SSH key is generated at the same time as a private key. Unlike a private SSH...