Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 921
Vadim Zolotokrylin Avatar asked Oct 24 '25 05:10

Vadim Zolotokrylin


1 Answers

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

vagrant box add <box> http://user:[email protected]/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

like image 188
Frederic Henri Avatar answered Oct 26 '25 18:10

Frederic Henri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!