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

<p>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?  </p>

<p>I have not been able to find anything in the FileZilla documentation related to this.</p>

[{'answer_id': 44519, 'author': 'Andrew Burns', 'author_id': 3683, 'author_profile': 'https://Stackoverflow.com/users/3683', 'pm_score': 0, 'selected': False, 'text': "<p>Unless I am misunderstanding you: you don't need to.</p>\n\n<p>If you connect to the server with another application (ie: PuTTY) and it has not seen the server before then you will be prompted to accept the key.  </p>\n\n<p>I see why you might want to do this,  but each application could have it's own way to store keys.</p>\n"}, {'answer_id': 44676, 'author': 'Tom Mayfield', 'author_id': 2314, 'author_profile': 'https://Stackoverflow.com/users/2314', 'pm_score': 5, 'selected': True, 'text': "<p>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.</p>\n\n<p>Putty also stores host keys, but it appears to encode them in hex. Those can be found at HKCUR\\Software\\SimonTatham\\PuTTY\\SshHostKeys</p>\n"}, {'answer_id': 44712, 'author': 'Doug Porter', 'author_id': 4311, 'author_profile': 'https://Stackoverflow.com/users/4311', 'pm_score': 3, 'selected': False, 'text': '<p>Thomas was correct.  FileZilla piggybacks on PuTTY\'s PSFTP program and stores the saved keys encoded in a hex format at the registry key he listed (HKCUR\\Software\\SimonTatham\\PuTTY\\SshHostKeys).  I needed the key in known_hosts format, so I has able to install a <a href="http://sshwindows.sourceforge.net/" rel="noreferrer">windows version of openssh</a> at his recommendation and used the ssh-keyscan tool to hit the server and save the key info out in the correct format: </p>\n\n<pre><code>ssh-keyscan -t rsa &lt;my_ftp_ip_address&gt; &gt; c:\\known_hosts\nssh-keyscan -t dsa &lt;my_ftp_ip_address&gt; &gt; c:\\known_hosts\n</code></pre>\n\n<p>Thank you Thomas and SO!</p>\n'}, {'answer_id': 12189504, 'author': 'Nasri Najib', 'author_id': 1631784, 'author_profile': 'https://Stackoverflow.com/users/1631784', 'pm_score': 3, 'selected': False, 'text': '<p>Thanks Dougman for the tip!</p>\n\n<p>To further help any newcomers reading your answer. <br>\nPrior to running the ssh-keyscan, assuming the openssh is install by default, there is a few commands that needs to be run (read the quickstart/readme install for details). \n<br>\nHere are my commands which allow me to obtain the host key.</p>\n\n<pre><code>C:\\Program Files\\OpenSSH\\bin&gt;mkgroup -l &gt;&gt; ..\\etc\\group\nC:\\Program Files\\OpenSSH\\bin&gt;mkpasswd -l &gt;&gt; ..\\etc\\passwd\nC:\\Program Files\\OpenSSH\\bin&gt;net start opensshd\nThe OpenSSH Server service is starting.\nThe OpenSSH Server service was started successfully.\nC:\\Program Files\\OpenSSH\\bin&gt;ssh-keyscan -t rsa vivo.sg.m.com &gt; c:\\known_hosts\nvivo.sg.m.com SSH-2.0-Sun_SSH_1.1\n</code></pre>\n'}, {'answer_id': 35758818, 'author': 'drzaus', 'author_id': 1037948, 'author_profile': 'https://Stackoverflow.com/users/1037948', 'pm_score': 3, 'selected': False, 'text': '<p>If you\'d rather use a GUI, you can snag the host key from the log window or the first-time connection popup using WinSCP FTP client: <a href="https://winscp.net/eng/docs/ssh_verifying_the_host_key" rel="noreferrer">https://winscp.net/eng/docs/ssh_verifying_the_host_key</a></p>\n'}]
['https://Stackoverflow.com/questions/44089', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4311/']