4

Geolite2 access changed on 12/30.

Today I registered for a Maxmind account, registered a license key (both one that "Will this key be used for GeoIP Update?" and one that will not) .. and now each time I enter I get a 401:

smachine:~# wget "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN-CSV&token=n3fU000000000000&suffix=zip"
--2020-01-13 00:37:23--  https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN-CSV&token=n3fU000000000000&suffix=zip
Resolving download.maxmind.com (download.maxmind.com)... 104.16.37.47, 104.16.38.47, 2606:4700::6810:252f, ...
Connecting to download.maxmind.com (download.maxmind.com)|104.16.37.47|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.
smachine:~#

Any ideas what I'm doing wrong here?

jg3
  • 503
  • 5
  • 12

2 Answers2

5

If you are using wget or curl from a shell script, please be sure to quote the URL.

By the way, if you're not root user, use sudo before the commands.

Sakeador
  • 59
  • 1
  • 3
4

Figured it out ... I failed to heed the instruction on https://dev.maxmind.com/geoip/geoipupdate/#Direct_Downloads where it said that you need to change token= to license_key= ... once I did that it worked as expected.

jg3
  • 503
  • 5
  • 12
  • 1
    I forgot to quote the URL in my wget... noob mistake but your question / answer combo made that clear to me. Thanks! – Shrout1 May 25 '20 at 14:27
  • @Shrout1 your comment was super useful and solved it! By the way, why are these quotes needed here? – Basj Dec 27 '20 at 06:46
  • 1
    @Basj it appears that the shell is [expanding the ampersand in the URL](https://serverfault.com/a/496953/195759) if it isn't escaped, thus breaking the request. [The wget manual](https://www.gnu.org/software/wget/manual/wget.htm) mentions this, though I had to look it up. It says "You may have to quote the URL to protect it from being expanded by your shell." Hope that helps! – Shrout1 Dec 28 '20 at 16:09