LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   wget not working (https://www.linuxquestions.org/questions/linux-newbie-8/wget-not-working-816272/)

ravibhure 06-25-2010 01:24 AM

wget not working
 
Hi,
I am trying to download data/file from web server where htpassword has been setup, I have tried with browser it its working fine, but when trying to same with 'wget' its not working, can you please suggest how to download the file.
Below is the command I am using.

wget https://admin:password@10.0.0.1/filename
admin[:]password (may be smily get overide)

IW2B 06-25-2010 03:48 AM

Hi Ravi,

Is it an authentication error that you are getting like the following?:

"HTTP request sent, awaiting response... 401 Authorization Required Authorization failed"

Your command syntax works fine for my on Fedora 13, GNU Wget 1.12. Perhaps its a character in the password that is causing problems if its not escaped properly, i.e. if it contains a ! or "... it may need to be escaped with a backslash before it.

If your version off wget supports it, you can also try the following:

Code:

wget --user=admin --ask-password 10.0.0.1/filename
then type the password when prompted, it will at least confirm that the wget/username/password combination is actually working.

Ian

Guttorm 06-25-2010 03:51 AM

Hi

What kind of error message do you get? One common problem is that the certificate is not properly signed. The first time you tried it with a browser, did you get some message about the certificate? If you clicked continue and add exception to make it work, you need to do the same for wget.

You can use the extra option --no-check-certificate with wget, like this:

Code:

wget -no-check-certificate https://admin:password@10.0.0.1/filename

ravibhure 06-28-2010 12:35 PM

Hi Guttorm/Ian,
I am able to download file now
wget --no-check-certificate https://admin:secretpass@10.0.0.1/filename.log

but still I am not able to download the files those are in query string, please suggest the way to download these.

wget --no-check-certificate https://admin:secretpass@10.0.0.1/my...s&NFS=netapp00

It gives an error 404 not Found, to verify I have check the file founds when I open it through browser.

colucix 06-28-2010 01:52 PM

You can give a try to --post-data (see man wget for details):
Code:

wget --no-check-certificate --post-data 'rootDir=logs&NFS=netapp00' https://admin:secretpass@10.0.0.1/mydir/subfolder/myapp.log


All times are GMT -5. The time now is 01:30 PM.