When using cURL or Wget to access data over HTTP from a web server configured for Earthdata Login authentication.
> cd ~
> touch .netrc
> echo "machine urs.earthdata.nasa.gov login uid_goes_here password password_goes_here" > .netrc
> chmod 0600 .netrc
uid_goes_here
is your Earthdata Login username and password_goes_here is your Earthdata Login password. Note that some password characters can cause problems. A backslash or space anywhere in your password will need to be escaped with an additional backslash. Similarly, if you use a '#' as the first character of your password, it will also need to be escaped with a preceding backslash. Depending on your environment, the use of double-quotes " may be turned into "smart-quotes" automatically. We recommend turning this feature off. Some users have found that the double quotes are not supported by their systems. Some users have found that the > is aliased to >> on some machines. This will append the text instead of overwrite the text. We recommend checking your ~/.netrc file to ensure it only has one line. > echo "machine urs.earthdata.nasa.gov login some_user password ABCdef123!" > .netrc
> cd ~
> touch .urs_cookies
> curl -O -b ~/.urs_cookies -c ~/.urs_cookies -L -n http://server/path
> wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --keep-session-cookies http://server/path