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

I‘ve recently regenrated and uploaded a new public ssh-key using the ssh-copy-id command. Now I’m getting the following error:

ssh root@server3
Agent admitted failure to sign using the key.
root@server3’s password:

How do I fix this problem?

Tutorial details
Difficulty level Easy
Root privileges No
Requirements ssh-add/Linux
Est. reading time 1m
To fix this problem you need logout of your Unix / Linux / OS X / BSD desktop session and log back in again to force the agent to forget identity. Another recommend option is to run the ssh-add command to add RSA or DSA identities to the authentication agent. This will fix your problem without login out from the current session. The syntax is as follows:

$ ssh-add

Pro tip: If your key located in different path or does not have the default filename, you will need to pass the path to ssh-add command as follows:

$ ssh-add /path/to/my/ssh_key
$ ssh-add ~/.ssh/server3_key

See ssh-add(1) command man page for more information.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 37 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
37 comments… add one
  • Luis Hernandez Jan 24, 2012 @ 20:14

    Great tip !!!

  • Marcia Cupery Jun 13, 2012 @ 3:19

    Came across this answer after trying a million things. I can’t believe it was that simple. Thank you!!!

    • kanna Mar 28, 2015 @ 18:21

      pleass can u explain it detailed…

  • Manojkuamr Jul 9, 2012 @ 13:46


  • Luiyo Jul 23, 2012 @ 18:18

    ssh-add worked for me!!


  • Julian Bruno Aug 2, 2012 @ 1:51

    ssh-add worked for me!!


  • Jose Aug 15, 2012 @ 23:24

    This was a great reference starting page,
    kl thanks

  • manas ranjan palai Aug 29, 2012 @ 11:38

    **Agent admitted failure to sign using the key.**

    ssh-add is ultimate solution for above problem.

  • James Ritchie Sep 4, 2012 @ 11:29

    Yup: this approach worked for me. Got this error during trial Grid Infrastructure installation over pair of Oracle Linux 6.2 VMs in virtualbox on laptop. Cheers Vivek. No reference to this in E22489-06. Maybe Oracle should pay *you* a license…

  • manas ranjan palai Sep 5, 2012 @ 8:39

    Actually i tryed ssh-add command in ubuntu 10.04 when i want to logged in to remote linux system without password ,there is an error message came ”Agent admitted failure to sign using the key” and it asked for password then i try ssh-add command and it works fine.

    Above error came after creating keys.

  • sirvon Sep 8, 2012 @ 23:35

    was discouraged in the past about password-less ssh
    but this post
    has me dancing!

  • Ozan Nov 8, 2012 @ 9:42

    thank you, you saved the day one more time

  • nagu Jan 25, 2013 @ 5:39

    you done a great job., Thanks for the great tip.

  • Amal Murali Feb 17, 2013 @ 13:07

    Great. This fixed it, thanks!

  • Pratheep Mar 20, 2013 @ 7:33

    Thanks a lot…ssh-add worked for me!

  • kiritisai May 18, 2013 @ 12:55

    thank you very much, that was really helpful for cloning my repository.

  • Tim Jul 9, 2013 @ 10:17

    Thank you for this. I’ve been smashing my forehead against the keyboard all day. ssh-add did the trick for me!

  • Japan Shah Oct 8, 2013 @ 18:07

    Simply Amazing.
    It works, you have saved me.


  • balamurugan Oct 20, 2013 @ 13:39

    super, i spend whole day to fix issue finally you helped me lot…

    Keep it up very very thanks……

  • Vitor Nov 21, 2013 @ 15:07

    Great post!

  • Jayaram Sudheer Jan 23, 2014 @ 6:55

    Thanks,it helped me a lot…

  • Anurag Jajoo Feb 11, 2014 @ 11:29

    Thanks a lot!
    ssh-add solved my problem

  • muthu Feb 11, 2014 @ 11:45

    Its working…

  • M Tandon Mar 2, 2014 @ 3:00

    Hi Guys, I am working on Linux 6.5 under VM Machine and on my Oracle Install, I got suck with it, with ssh connectivity, and I tried it on terminal with the ssh-add command and it worked as charm, but later on Install it again failed and I tried on terminal it again started asking me to put the password, Any idea what else is stopping the Agent again and getting the under mentioned Message and who to move on it.
    “” Agent admitted failure to sign using the key””

  • M Tandon Mar 2, 2014 @ 22:46

    Finally did the by-pass of Agent with command as “” SSH_AUTH_SOCK=0 “”

  • Eva Apr 19, 2014 @ 11:14

    Thanks, worked for me!

  • Peter May 8, 2014 @ 21:30

    Thanks for the solution. But here’s a better one, better than restarting the desktop:

    forget about keys:

    ssh-add -D

    and then optionally add your key again:


  • Arup Sarker Sep 25, 2014 @ 12:06

    You haved saved my day, man :)

  • Ankush Nov 11, 2014 @ 0:44

    Great tip.It worked for me.

    This post is really very helpful.
    Thanks a lot.


  • Jim Nov 20, 2014 @ 16:01

    This does not work for me. After doing ‘ssh-add’, I now get the “Agent admitted failure to sign using the key.” message twice. I didn’t use to get this message at all, but now lately it has started happening. What am I doing wrong?

  • Jesus Mar 26, 2015 @ 18:42

    it worked!, thanks a lot!

  • tcpdump Apr 16, 2015 @ 9:22

    same problem here => “Agent admitted failure to sign using the key.”
    there is a bug report for this…

    but unfortunately it offers only workarounds

  • gavin May 1, 2015 @ 22:15

    lol this worked for me too with openshift. wow. I even closed my terminal window, reopened, and restarted zshell by typing `zsh`.

  • Marcelo Jul 21, 2015 @ 12:03


  • Aravind S Jul 31, 2015 @ 7:31

    Great tip that saved my day Vivek …Thanks a lot !

  • Suneel Aug 20, 2015 @ 6:20

    That’s a great tip, It worked for me too….. Thank you.

  • JP Feb 25, 2016 @ 14:03

    Another thank you.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum