How to supply user and password to download USGS data with wget?

I think that has recently applied a login and pass authentication to retrieve data. my script was working before, but now it comes with an error HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.

I have login and pass, so how and where do I put it in the script? cheers

#!/bin/sh    for YEAR in  2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 ;   do      wget -r -l1 -p -nd -e robots=off -A "*h17v03*","*h18v03*" -R .jpg -R .xml$YEAR.07.03  wget -r -l1 -p -nd -e robots=off -A "*h17v03*","*h18v03*" -R .jpg -R .xml$YEAR.07.04 done    #!/bin/sh 


Indeed the LP DAAC access requires authentication (as of 20 July 2016). You need to use your "Earthdata" login (not USGS login, if you've previously been coming in from there).

You also need to authorise that Earthdata login on the Earthdata profile page.

USGS provided some command line tips, of which the following is in the wget specific section:

wget -L --load-cookies ~/.cookies --save-cookies ~/.cookies

The reason why the --username and --password options don't appear is that best practice is to use a .netrc file, which looks like:

        login username
        password userpassword

(or whichever other machines in the data pool you are using).

Category: modis Time: 2016-07-30 Views: 0
Tags: shell modis

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 3.625 (s). 13 q(s)