FTP client text settings behind the proxy server

I need to create a bash script that will connect to an FTP server, upload a file and close the connection. Usually this would be a simple task, but I need to specify some proxy server settings that make work difficult.

I can connect to an FTP file using a GUI client, i.e. Filezilla with the following settings:

Proxy Settings
--------------
FTP Proxy : USER@HOST
Proxy Host: proxy.domain.com
Proxy User: blank
Proxy Pass: blank

Proxy settings

FTP Settings
------------
Host : 200.200.200.200
Port : 21
User : foo
Pass : bar

FTP Settings

What I cannot do is to replicate these parameters in a text ftp client like ftp, lftp etc. Can anyone help with setting this script up?

Thanks in advance!

+3
source share
1 answer

According to docs it lftp should support an environment variable ftp_proxylike

ftp_proxy=ftp://proxy.domain.com lftp -c "cd /upload; put file" ftp://200.200.200.200

If this works, you can put

export ftp_proxy=ftp://proxy.domain.com

set ftp:proxy=ftp://proxy.domain.com

~/.lftprc.

, FTP- GUI,

upload.lftp

USER ...@...
PASS ...
PUT ...

-s:

lftp -s upload.lftp 200.200.200.200

curl -T (docs) ncftpput ().

- :

FTP_PROXY=ftp://proxy.domain.com curl -T uploadfile -u foo:bar ftp://200.200.200.200/myfile

.

+4

All Articles