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

cfftp and Winscp

Participant ,
May 28, 2009 May 28, 2009

Gentlemen,

I am writing a script to connect o a remote SFTP server. The server that I am trying to login to requires a "private key" which is a file that the remote authentication process uses to log you in. In Winscp I browse to the file that is my key. That is in addition to my host server name, username and password. Using cfftp I can specify the host, the username and the password but I don't know what to do when it comes to this file which is my key: filename.ppk.

Any thoughts anybody?

And I need to pass that file so my connection gets established.

Thanks!

Ysais.

TOPICS
Advanced techniques
1.5K
Translate
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
Enthusiast ,
May 29, 2009 May 29, 2009

As far as I'm aware ColdFusion doesn't support SFTP out of the box,

you'll need to use external libraries (for example

http://www.jcraft.com/jsch/).

Mack

Translate
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
Enthusiast ,
May 29, 2009 May 29, 2009

Scratch that, SFTP is supported in CF8.

Mack

Translate
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
Participant ,
May 29, 2009 May 29, 2009

Thanks Mack, Now I am trying to extablish a secure FTP connection and my code is complaining about the attribute connection. I am really troubled since I need to specify a connection name to be able to reuse my connection again. This is my code:

<cftry>
<cfftp action="open" connection="VeratadFtpConnection" fingerprint="#variables.fingerprint#" key=\\server\path\key.ppk passphrase="passphrase" secure="no" server="ftp.server.com" stoponerror="no" username="someuser">
<cfcatch type="any">
  <cfoutput>
  #cfcatch.Message#<br />
  #cfcatch.Detail#<br />
  #cfcatch.Type#<br />
  </cfoutput>
</cfcatch>
</cftry>

Translate
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
Enthusiast ,
May 29, 2009 May 29, 2009

What is the complete error message that you're getting ?

Mack

Translate
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
May 29, 2009 May 29, 2009

Can you get your keyfile via a cffile call?  It may be the mapping there?  If a cffile can see that exact path and dump your key to screen, then it's not that.

The key attribute requires an absolute path.

Translate
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
Participant ,
May 29, 2009 May 29, 2009
LATEST

This is the error message I am getting!

Message

invaid privatekey: \\pnky\wbdata\retail\cig\famoe.ppk

Translate
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