Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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.