0

I used Pageant to add keys to it from a C# code behind. I found that I can use the command line to add keys to Pageant described here:

http://the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter9.html#pageant-cmdline

It works fine, but I start thinking how can I remove a key from Pageant using the command line client? Is there any way to remove them somehow? After a while I have a lot of loaded keys from different users and I think that is the reason why the authentication method doesn't work well.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Gábor Domonkos
  • 1,081
  • 1
  • 17
  • 33

1 Answers1

1

It's not possible to remove keys from Pageant using a command-line.

This used to be on a wishlist:

We can already add keys to the primary Pageant, but it might be good to be able to delete keys or shut it down as well.

But it's not anymore.


Also the only way to add key to Pageant automatically is to have the key unencrypted. What defies a purpose of Pageant.

So, I do not see a point of this. Why don't you use the key directly? Do you use some SSH client/library that does not allow using key directly, but supports Pageant?

Anyway, you may kill Pageant and (re)load some keys.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • Yes, I want to push to a Bitbucket repository, using an SSH URL, that's why I need the Pageant. – Gábor Domonkos Nov 08 '14 at 16:47
  • 1
    See [How do I tell Git for Windows where to find my private RSA key?](http://serverfault.com/questions/194567/how-do-i-tell-git-for-windows-where-to-find-my-private-rsa-key) – Martin Prikryl Nov 08 '14 at 17:38
  • Thank you very much! But in case of Mercurial, if I delete the private key files there are still on the Pageant Key List. Yes, I can kill Pageant and after a restart, the list is empty, but I think this isn't the more elegant way to solve this problem. – Gábor Domonkos Nov 10 '14 at 12:31
  • I never used Mercurial. But even with Mercurial there has to be a way to use private key file directly, without Pageant. See for example [How to let TortoiseHg (Mercurial) on Windows use the Private Key file generated (by Puttygen)?](http://stackoverflow.com/questions/2951011/how-to-let-tortoisehg-mercurial-on-windows-use-the-private-key-file-generated) – Martin Prikryl Nov 10 '14 at 12:53
  • The wishlist link is broken. – Jeremy Oct 17 '16 at 20:40
  • @Jeremy True. It was removed from the wishlist. I've fixed the links. – Martin Prikryl Oct 18 '16 at 06:27