lftp behind a proxy

lftp1 If you use lftp as ftp client and you want to connect to an ftp site, but a (Squid) proxy that is blocking the access then you can solve it by adding these options in:

  • /etc/lftp.conf if you want the change to be global
  • ~/.lftp/rc if you want to make the change for the current user
# Sets the proxy server
set http:proxy http://user:password@proxy-server:port
# Set the user agent that will send to the proxy server very useful if your network administrators are paranoid and only supported known user agent
set http:user-agent 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)'

Further reading

- man lftp
- man lftp.conf

The tutorials here on LibreByte are provided under a free software licence. if you like my work you should consider:
Buy a Hosting/VPS or Dedicated Server at MCKHost

2 comments

  1. Why are you setting http:proxy for FTP? Do you mean ftp:proxy? Have you actually got this working?

  2. The above configuration works well due lftp can use HFTP protocol, you can see https://www.librebyte.net/en/ftp/ftp-behind-a-proxy-or-firewall/ for more details

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.