3

I have Ubuntu 16.04 installed on my pc. My network require http proxy to access the internet.

Say Proxy is "xxx.xx.xx.xx" and port is "8080".

I set up system proxy for http, https and ftp. I am able to access internet through terminal. But I am able to access FTP server only in web browser, not in terminal.

When i try to access FTP server, i get :

user@hostname:~$ ftp ftp.example.org
ftp: connect to address 213.138.116.78: Connection refused
Trying 2001:41c8:112:8300::15:0...
ftp: connect: Network is unreachable
ftp> 

It working with VPN.

Any help is appreciated.

Sanjay Prajapat
  • 151
  • 1
  • 3
  • 8

2 Answers2

4

Install lftp. It has an ftp proxy environment variable that you can set to connect through proxy from the command line. lftp man page

Example:

user@yourmachine:~$ sudo apt-get install lftp

[...]

user@yourmachine:~$ lftp
lftp :~> set ftp:proxy http://proxyuser:proxypass@yourproxyIPorHOSTNAME:port 
lftp :~> open ftp.example.com 
lftp :~> USER ftpUSER
password: ftpPASS
Marco
  • 1,709
  • 3
  • 17
  • 31
3
  1. Set ftp_proxy in env

    export ftp_proxy="http://xxx.xx.xx.xx:8080"
    
  2. After that when you use ftp command, it is auto add proxy server.

    ftp ftp.example.org
    
  3. If no longer need proxy.

    unset ftp_proxy
    
RalfFriedl
  • 3,108
  • 4
  • 13
  • 17