Page 1 of 1

Unable to change private key file

Posted: 2020-09-01 15:19
by RelevantDad
Hello all,

I'm trying to use a new private key to connect to a server. I changed the path in the site manager and tried to connect. I renamed my old private key file, so that it wouldn't try to use the old key. I'm getting an error saying "Unable to open file" with the path to the old key file.

I checked the settings > Connections > SFTP and there was no key file stored there. And it's set correctly in the Site Manager to the new path. How can I force this to use the new file?

Re: Unable to change private key file

Posted: 2020-09-01 16:20
by boco
FileZilla uses PuTTY technology for its SFTP support. As such, it shares the configuration in the Registry.

If you open Regedit.exe, you might still find information about your old SFTP key:

HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys


Did you close FileZilla to clear the session and then re-open it? Oh, and don't use the "Reconnect to last server" feature in this case, as it would still have the old information stored.

Re: Unable to change private key file

Posted: 2020-09-01 16:52
by RelevantDad
Well removing the registry keys got the job done, thanks!

I still got an "Unable to use key" message for the old file. No idea how it still even knows about that file now.

But at least after that one failed, it still connected me (assuming using the new key)

So that works enough :D

Re: Unable to change private key file

Posted: 2022-09-21 14:07
by jwalker-app
I know that this post is a couple of years old, but the same thing just happened to me and I found the source of the error. I had created a new key pair for access to my SFTP server, but FileZilla was still finding a reference to the old key even though it didn't exist anywhere in the FileZilla configuration any more.

As @RelevantDad notes, renaming or deleting the old key will prevent it from loading, but the error message still displays in FileZilla.

@boco mentioned that FileZilla uses PuTTY settings.

The old key had been set to be my PuTTY default keyfile, so in the registry at Computer\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings\PublicKeyFile the path and filename of the old key was stored.

Blanking the value in this field made the FileZilla error disappear. It also seems to have corrected a timeout error I had been experiencing when connected to my server.

Hope this helps someone. Thanks for the guidance from the original posters.