Question

Regarding how to access the sftp location using private key in Fme server configured in Linux Env.

  • 12 October 2023
  • 3 replies
  • 20 views

I want to upload a file to sftp location and we have only private key for connecting. I tried using system caller by keeping this command inside that :

sftp -i <private_key_path> -b - user@hostname <<< 'put <path_file_to_upload> <path_remotepath_where_to_upload>'

and also tried with this command also:

sftp -o -i <privatekey_path> user@hostname

 

but none of the commands worked in fme server, it is showing as failed to execute the command, Am I giving the correct commands or could anyone help me out on how to connect to sftp using private key in fme server configured on linux env.


3 replies

Badge

Hi @gowripriya2k​ ,

Are you using the FTPCaller after the SystemCaller?

Here are a couple of relevant resources that may be helpful to get started:

Hope this helps,

Kezia

Hi @gowripriya2k​ ,

Are you using the FTPCaller after the SystemCaller?

Here are a couple of relevant resources that may be helpful to get started:

Hope this helps,

Kezia

Yeah I am using ftp caller after the system caller, it is working locally but after deployment to fme server , it is not working and showing as failed to execute command in system caller

 

Userlevel 2
Badge +17

Hello @gowripriya2k​,

Please try the following instructions to use a private SSH key with the FTPCaller on a Linux FME Flow (formerly known as FME Server). Note that you will need an account with root access on the Linux machine where FME Flow is installed.

 

1. Modify <FMEFlowDir>/Server/startEngines.sh to add the line: 

eval `ssh-agent` > /dev/null

This sets the SSH_AUTH_SOCK environment variable, required for ssh-agent to run, for the account running the engines.

2. Upload the ssh private key to Flow using the web UI. The owner of the key should be the account running the engines. In an express install on default settings, this account is fmeserver.

3. Modify the permissions as root (eg. using sudo) of the uploaded SSH private key so it is read/writable only by the owner using: 

chmod 600 <pathToKey>

This is to avoid the permissions too open error

4. Restart FME Flow instance

 

Steps 1, 3, and 4 in particular requires access to the machine where Flow is installed along with an account with root access. You may need to reach out to your FME Flow and/or system admin to perform these steps.

 

Instructions were tested on an express installation of FME Flow 2023.2 on Ubuntu 22.04.

Reply