1

I made a mistake and deleted my ssh key, but ssh-add -l still lists it and when I do connect to a server using ssh, it will recognize it and connect, making me believe that the private key is still stored somewhere on ssh-add.

Is there a way to recover that key?

Thanks.

Maurício Giordano
  • 2,597
  • 3
  • 26
  • 54
  • A better bet would be to use the stored key to log into those servers and set up a new key. – Nate Eldredge May 13 '21 at 02:47
  • @NateEldredge already did that :) but that key is special, I have it set on dozens of locations. – Maurício Giordano May 13 '21 at 02:51
  • Then I think you get to attach a debugger to the running `ssh-agent` and try to find your private key in its memory. Maybe someone here will be familiar enough with the source to give you an idea what part of the code to search for its address. If your installation provides an unstripped binary or a symbol table for `ssh-agent`, that may make it simpler. Don't expect it to be simple, in any case. – Nate Eldredge May 13 '21 at 02:56

0 Answers0