ssllftp

How to use lftp for connecting to an FTPS file server and pushing files to their server


We need to connect to one of the FTPS file servers and push the files on a hourly basis. We are able to connect to their server using lftp after setting certificate, key files using set ssl:cert-file, ssl:key-file, but we need help in sending files to their server using an automated shell script.

We have to follow the below while connecting to their server (we are not sure how to follow these, while transferring commands and files to their server)

  1. For the control channel we have to use one port (example port: 13021)
  2. For the data channel we have to use other port range (example: 13100 to 13199)
  3. For transport encryption we have to use 2048 bit explicit SSL (control and data channel)

How can this be done?

The below screenshot contains debug information for the ls and put commands. The Put command failed with an error.

Enter image description here


Solution

  • At last, I am able to upload files to their server. I have set the below parameters in the lftp session, and it worked for me.

    1. set ssl:cert-file /path/to/somecert.crt
    2. set ssl:key-file /path/to/somekey.key
    3. set ftp:ssl-protect-data true
    4. set ftp:use-site-utime2 false