Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:pass@download.site.co.in/

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?

share|improve this question
This question might be better placed on superuser.com – glenn jackman Mar 24 '11 at 15:51
is the proxy configured in the system? – D4RIO Mar 24 '11 at 16:19
It is configured via environment variable ftp_proxy – Farhat Mar 25 '11 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). – barrycarter Mar 26 '11 at 15:45

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.