Search code examples
ssllftp

how to use lftp for connecting to a ftps file server and pushing files to their server


we need to connect to one of the FTPS file server 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 need help in sending files to their server using an automated shell script.

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

  1. For Control channel we have to use one port (example port: 13021)
  2. For 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)

If any have tried it earlier, please share your inputs here.

The below screen shot conatains debug information for ls and put command. Put command is failed with error. enter image description here


Solution

  • At last I am able to upload files to their server. I have set the below parameters in 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