Vadim Zolotokrylin
Vadim Zolotokrylin

Reputation: 58

Vagrant can not access the box over HTTP Basic Auth

Vagrant up can access and download my Vagrant box (that I packed and placed on my hosting) by http://devops.example.com/vagrant.box. But I do not want my box to be public, and want to protect is by using HTTP Basic Auth. When I turn on Basic Auth and do 'vagrant up', Vagrant returns message with 401 error.

How can I configure Vagrant, so it can access the box over Basic Auth?

Thanks in advance, Cheers!

Upvotes: 4

Views: 1341

Answers (1)

Frederic Henri
Frederic Henri

Reputation: 53813

For HTTP Basic Authentication, you can do (from Vagrant 1.8)

vagrant box add <box> http://user:pass@devops.example.com/vagrant.box

In some older version of vagrant, the following is working

vagrant box add <box> http://devops.example.com/vagrant.box -u user:pass

If you distribute your box on vagrantcloud you can enable better authentication, you can review https://atlas.hashicorp.com/help/vagrant/boxes/distributing

Upvotes: 6

Related Questions