How To Extract SFTP SSH Key From Key Cache in FileZilla FTP Client

Doug Porter picture Doug Porter · Sep 4, 2008 · Viewed 58.4k times · Source

I have connected to a server via SFTP using FileZilla and accepted adding the server's SSH key to the key cache in FileZilla.

How can I extract this cached key to a keyfile so that may use it through other SFTP applications that require a keyfile be made available?

I have not been able to find anything in the FileZilla documentation related to this.

Answer

Tom Mayfield picture Tom Mayfield · Sep 4, 2008

If you use the standard openssh console client (cygwin or from linux), host keys are stored, one-per-line, in ~/.ssh/known_hosts. From there, it's a simple matter of figuring out which bit of that host key is needed for your library.

Putty also stores host keys, but it appears to encode them in hex. Those can be found at HKCUR\Software\SimonTatham\PuTTY\SshHostKeys