Thursday, March 22, 2007

Clear Putty's Cache

For all those of you who have been trying to clear Putty’s cache of host fingerprints (Windows) for development or testing, here is the answer:

1. Open the registry (regedit)
2. Go to HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys

There you should see Putty’s cache of host keys.
The ‘name’ column tells you which key is for which server.

For example, it will have the format of <algo>@<port>:<host> [rsa2@22:172.16.117.159]

3. Delete the rows that you need and presto!

That’s all there is to it.

12 comments:

Tim said...

Good tip, thanks for the info. I found this useful as I had a script running plink from a service, as the SYSTEM user, which would fail because the server wasn't found in the cache.

I went into HKEY_CURRENT_USER as you describe and found the right key. I then went into HKEY_USERS/.../Software/SimonTatham etc. and pasted the data in. I had to guess as to which of the entries was the SYSTEM user, though.

Anonymous said...

Very usefull

Anonymous said...

thanks

George said...

This is perfect, Thanks or this been looking for hours on how to delete this damn sha key.

0x1337 said...

why use brute force?
putty -cleanup
and you're done

Anonymous said...

^ agree with this.
Simply open up a command prompt, go to the location of your putty.exe then execute

putty -cleanup

plink said...

This method is selective.
Putty -cleanup removes all

Anonymous said...

Thanks for the info. I also needed a selective method as described in the post. But it is nice to know about the -cleanup parameter as well.

Anonymous said...

thanks...its a really a nice help

Anonymous said...

Yes it's really helpful

Anonymous said...

Thanks a lot, it's really useful.

Anonymous said...

Thanks a lot. I can connect to my host after clearing the cache. saved my day....