How can we transfer file from Adobe Campaign to an external SFTP using the private-public key?

subhajit9830660

22-09-2017

Hi,

We have to transfer a file from Adove Campaign v6 to an external SFTP using private-public key and passphrase combination. We cannot use the SFTP connecter available in Adobe Campaign. We tried writing some curl commands in the shell script, but nothing worked.

Has anyone done any such implementation?

Thanks,

Subhajit

Accepted Solutions (1)

Accepted Solutions (1)

Amit_Kumar

MVP

24-09-2017

Hi, Subhajit,

Did you create, your public and private keys for Adobe campaign server(Client)? If yes, do you have an ssh directory for this user on your SFTP server? If you are not sure how to do use ssh keys with SFTP server, read these two links.

Setting Up SFTP Public Key Authentication On The Command Line

SSH with Keys HOWTO: SSH Keys with a passphrase

These steps will only work if you are hosting your Classic version on-premise otherwise raise a request with Adobe customer care to do the setup for you.

Regards,

Amit

Answers (5)

Answers (5)

hansangy1377908

22-04-2019

Update on this for future people's benefit:

We were able to set up the curl command as per below, first by creating the curl string:

var upload = 'curl --verbose -k -T /sftp/<your folder>/incoming/' + instance.vars.filename + ' -u <name of sftp user>: --key <location of private key> --pubkey <location of public key> sftp://<destination SFTP folder>:22/uploads/sftp/in/

Note that

  • Both private & Public keys must be specified for the version of CURL that is installed on AC
  • destination sftp URL needs to be followed up / (to indicate folder, rather than create a file name)

Then run this in your js/file transfer activity

exec(upload);

}catch(e){

logInfo("ERROR = " +e.message);

}

subhajit9830660

24-09-2017

Hi Amit,

Thanks for the response.

My requirement is actually different here. I do not want to encrypt the file. I want to send a file to an external SFTP, but I cannot use the username-password for it. I have the private key, public key and the passphrase and can only use them to connect to the SFTP. I tried writing a shell script (curl command) but it does not work. Have you used any such shell script?

Thanks,

Subhajit

Amit_Kumar

MVP

24-09-2017

Hi, Subhajit,

have you seen this?

Encrypt Data Files and Push to SFTP (How to)

This is exactly how you can use sftp to make it work.

If this is not working, use file export activity to create a file in your server location, encrypt that file using:

function encryptFile(file) {   
  var systemCommand = "gpg --encrypt --recipient  recipientToEncryptTo " + file;  
  var result = execCommand(systemCommand, true);
}

Copy and move that file to your SFTP  location using a shell script.

Hope this helps!

Amit

hansangy1377908

02-12-2018

We have this requirement as well.

To confirm, Amit are you saying there is NO built in support for SSH auth (Public-Private Key + passphrase) in campaign classic?

I have seen this thread as well File transfer to another SFTP server with SSH key based authentication and it seems to be the same.

Thanks,

Hungy