I am trying to use wget for downloading files from a ftp repository. The FTP repository has a login and password. I have to go through a proxy server which does not have a login and password. When I try to use the normal,

wget -r -c ftp://login:[email protected]/

I find that it tries to login to the proxy server itself rather than the ftp server causing it to hang at that stage. using --ftp-user and ftp-password has the same effect. How can I get around this?

  • This question might be better placed on superuser.com Mar 24, 2011 at 15:51
  • is the proxy configured in the system?
    – D4RIO
    Mar 24, 2011 at 16:19
  • It is configured via environment variable ftp_proxy
    – Farhat
    Mar 25, 2011 at 9:05
  • Silly question: is your proxy server also an FTP proxy server? An HTTP proxy server uses the "Host:" line to figure out what page to grab. An FTP proxy server would have to be more clever (ie, know the IP address it's intercepting).
    – user2267
    Mar 26, 2011 at 15:45

1 Answer 1


I don't think wget supports the username and password in a URL. Try this form:

wget --user=login --password=pass ftp://download.site.co.in/

Better yet, you can store the username and password in .wgetrc or .netrc to prevent having to specify it on the command-line where it might be seen by other users or stored to a shell history file. I'm not sure about the format of .wgetrc, you can read the man page on wget for that. For .netrc, add a line like:

machine download.site.co.in login login pasword pass

And wget will automatically use that if not specified. Make sure the file is chmod 700 for permissions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .