Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

SFTP with Private key (ppk) file setup?

TimChandler
8 - Asteroid

I’m referencing: http://community.alteryx.com/t5/Alteryx-Knowledge-Base/Upload-to-SFTP-FTP-More-Examples-with-Alteryx... to setup a SFTP however this does not use a Private key.ppk file which I am required to use.

 

Anyone out there done SFTP with curl or the Run Command tool in Alteryx? Any sample code to ease my pain? I'm trying to write a text file to a server.

 

Thanks.

9 REPLIES 9
anthony
11 - Bolide

I use winscp for SFTP and I think they have the ability to use a private key. Possibly by using putty. I use putty and pageant(loads keys) for db connections with a fun complex port forwarding setup.

Ah, yeah, quick google https://winscp.net/eng/docs/public_key

 

You should be able to then use the command line tools in winscp via a run command/bat file to get what you need.

 

 

ulrich_schumann
8 - Asteroid

Hi anthony,

 

do you have any samples how to use this in the best way? Do you have further insights that you can share?

 

anthony
11 - Bolide

When I wrote last time, I did not actually have an example. But before long I had a need so i built it and figured out the script.

 

I use a DL tool and the below settings. Note the winscp.exe - that is the command line version.

 

 

 

Capture.PNG

 

The script looks like this - it took a lot of dorking around to figure out the fingerprint piece but it is explained in the manual. https://winscp.net/eng/docs/scripting Basically you have to login with the GUI and there is a option to get the fingerprint so you can use it in the script.

 

open sftp://USERNAME:PASSWORD;fingerprint=ssh-rsa-xx-xx-xx-xx-xx-xx-xx@reports.paypal.com/
cd "/ppreports/outgoing"
option transfer binary
synchronize local -filemask="*.csv" "C:\Users\Anthony\Google Drive\Paypal\PP FTP\Data" "/ppreports/outgoing"
close
exit

dtokarz312
8 - Asteroid

What did you use as the PASSWORD in this scenario? I have a USERNAME, PrivateKey, and PASSPHRASE. Where are you getting the PASSWORD value?

anthony
11 - Bolide

Did you try using the passphrase in place of the password?

 

Are you trying this with winscp?

 

Make sure you can access with the winscp application GUI with your credentials before you try using the script version.

dtokarz312
8 - Asteroid

Yes, I tried with the passphrase. I also was able to connect via WinSCP.

 

I know am seeing that my sFTP instruction explicitly state that "the account does not allow "ssh" connections to the host systems, only SFTP connections are permitted". 

 

Please confirm, but doesn't this process convert the private key / passphrase into an "ssh" connect then push it to the sFTP? 

That is why the new login looks like this fingerprint=ssh-rsa-c5-89-26-31-7e-d7-1b-31-d2@xyz.com?

anthony
11 - Bolide

I think you need to connect with private key.

https://winscp.net/forum/viewtopic.php?t=11709

 

with a script like this

https://winscp.net/eng/docs/commandline#session

dtokarz312
8 - Asteroid

Thanks but I have done all that already. The document I received that contains the sFTP login information states "the account does not allow ssh connection to the host system, only sFTP connections. Doesn't this process create an ssh connection to the host system? 

When my process fails this is the error I get. 

 

Error.JPG

anthony
11 - Bolide

Sounds like you need to ask for a password since what you have is for ssh.

Labels