Software⏱️ 2 min read📅 2026-05-31

How to Fix: Ubuntu 16.04 ssh: sign_and_send_pubkey: signing failed: agent refused operation

Quick Answer: Try removing the existing SSH keys and recreate them, then try to connect using ssh again.

The error message 'sign_and_send_pubkey: signing failed: agent refused operation' can be caused by several factors, including an outdated SSH agent or a misconfigured agent. Since you have already recreated your ssh keys and pushed them to the server using ssh-copy-id, it's possible that the issue lies with the SSH agent on your local machine.

✅ Best Solutions to Fix It

Method 1: Start the SSH Agent

  1. Step 1: Open a new terminal and run the command eval $(ssh-agent -s) to start the SSH agent.

Method 2: Add the Server's Public Key to the SSH Agent

  1. Step 1: Run the command ssh-add /path/to/public/key to add the server's public key to the SSH agent.

💡 Conclusion

By following these steps, you should be able to resolve the 'sign_and_send_pubkey: signing failed: agent refused operation' error and successfully use SSH to connect to your server.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions