Vagrant hostsupdater plugin without having to enter your sudo password

Vagrant – Great

Hosts Updater plugin – very handy

Having to enter your sudo password when the plugin edits your hosts file – really annoying.

I finally got around to addressing this on my dev system. Looking at the plugin source there are two sudo commands that we need to cater for. One to add hosts and one to remove.

Adding the following to my sudoers file worked a treat:

There are a couple of things to address when you add this to your own sudoers file:
1. Change ‘iain’ to your own user name
2. ‘sed’ might be running from a different path. You can find out by running: which sed