Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 888
Doug Porter Avatar asked Sep 04 '08 16:09

Doug Porter


People also ask

How do I find my SSH key in FileZilla?

Generate the SSH keyYou can generate an SSH key with PuTTY or OpenSSH. (Now OpenSSH is built-in in Windows.) PuTTY: use the GUI program PuTTYgen to generate an SSH key. OpenSSH: open cmd.exe or PowerShell, and type command ssh-keygen -t rsa -b 2048 -f my-ssh-key .

How do I use SFTP private key in FileZilla?

Right-click the icon and select “Add Key” and select your private key (PPK) file. Follow the prompt to enter your pass phrase and you're done. Now simply launch FileZilla Pro and connect to your server using SFTP using SSH2 with a username and an empty password. Don't forget to close pageant when you're done.

How do I find my SFTP key?

To obtain an SFTP private key as a user, log in to JSCAPE MFT Server through the Web User Interface. Once inside, click the link labeled My Account at the upper-right corner of the screen. Next, navigate to the section Public Key Authentication and then click Generate Key Pair.


2 Answers

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

like image 67
Tom Mayfield Avatar answered Sep 18 '22 15:09

Tom Mayfield


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 windows version of openssh at his recommendation and used the ssh-keyscan tool to hit the server and save the key info out in the correct format:

ssh-keyscan -t rsa <my_ftp_ip_address> > c:\known_hosts
ssh-keyscan -t dsa <my_ftp_ip_address> > c:\known_hosts

Thank you Thomas and SO!

like image 28
Doug Porter Avatar answered Sep 20 '22 15:09

Doug Porter