Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passwordless sudo on removing hosts not working #184

Open
ndberg opened this issue Oct 29, 2019 · 0 comments
Open

passwordless sudo on removing hosts not working #184

ndberg opened this issue Oct 29, 2019 · 0 comments
Labels

Comments

@ndberg
Copy link

ndberg commented Oct 29, 2019

System: macOS Mojave 10.14.6

I updated the sudoers file as recommended in README, but it does not work for removing hosts. For adding the hosts it works. I changed it directly to my username Andi as it didn't work with the admin group:

# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /bin/sed -i -e /*/ d /etc/hosts
Andi ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE
➜  homestead git:(master) ✗ vagrant destroy
    platreform: Are you sure you want to destroy the 'platreform' VM? [y/N] y
==> platreform: Forcing shutdown of VM...
==> platreform: Destroying VM and associated drives...
==> platreform: Pruning invalid NFS exports. Administrator privileges will be required...
==> platreform: [vagrant-hostsupdater] Removing hosts
Password:

Does anyone know how the correct command in the sudoers file would be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants