• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

SFTP Secure FTP and PPK, invaid privatekey

Guest
Jun 03, 2009 Jun 03, 2009

Copy link to clipboard

Copied

Hi,

     I am trying to connect via the CFFTP in CF8.

I have the privatekey in "PuTTY-User-Key-File-2: ssh-rsa" SSH format

Host Server MD5 fingerprint.

But I keep getting this error message:

Invaid privatekey:  [key name].ppk

<cftry>
<cfftp action="open" fingerprint="xx:xxx" connection="myconnection" key="c:\abc.ppk" passphrase="pass" secure="yes" server="sftp.server.com" port="22" stoponerror="yes" username="theUsername">
<cfcatch type="any">
  <cfoutput>
  <cfdump var="#cfcatch#">
  </cfoutput>
</cfcatch>
</cftry>

Thanks

TOPICS
Advanced techniques

Views

4.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 03, 2009 Jun 03, 2009

Copy link to clipboard

Copied

I believe this has been mentioned before in a similar thread, but you'll need to have the private key file in

OpenSSH format.  You can use a program named 'PuttyGen' to load the private key file, then "Export"

that to a new file in OpenSSH format.  Once you do that, use the newly exported file as you're key file

parameter and see how things go.

Michael

--

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 04, 2009 Jun 04, 2009

Copy link to clipboard

Copied

Yes,

The key was generated from WInscp Putty Key Generater, if you see the header in the post

"ssh-rsa"

there are 3 different kind of key that Winscp Generate

I am afraid that CF8 only support certain key type from OpenSSH and they are not the same as WinSCP's Putty Key?

SSH-1 (RSA)

SSH-2 RSA

and SSH-2 DSA

this the the key in the header in the ppk file

PuTTY-User-Key-File-2: ssh-rsa

Thanks,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 04, 2009 Jun 04, 2009

Copy link to clipboard

Copied

LATEST

Very true, but in the version of PuttyGen that I use (release 0.60), there is a menu option called [Conversions], and under that is an option [Export OpenSSH key].  Load your private key file, then select that option and try the resulting file with your CFFTP call.  I actually did this earlier this week and it works just fine with CF8.  You can not use the file you would normally save with PuttyGen, you must use the one you "export".

p.s.  Just to be clear, I generated a new key pair as "SSH-2 RSA", then exported it as an OpenSSH key file.  After installing the public key portion on the SFTP server, I used the exported (not the saved) private key file in the CFFTP tag, and all is working correctly.  If you try and use the saved SSH-2 RSA file, you'll get the "invaid privatekey" error.

Regards,

Michael

--

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation