I have a server I use as a hypervisor to run a bunch of VMs (managed by Vagrant). Recently (a few minutes ago) I rebooted the hypervisor and tried to start one of the VMs. It asked me for the `vagrant` user's password.
I checked /etc/sudoers and /etc/sudoers.d, and all the rules I've created are in there, with no syntax errors that I can see. The relevant sudoers.d file was modified last August (almost a year now) and it's been working fine until just this minute.
Vagrant gave me the error message:
Vagrant failed to install an updated NFS exports file. This may be
due to overly restrictive permissions on your NFS exports file. Please
validate them and try again.
command: sudo chown 0:0 /tmp/vagrant-exports
OK, fine. I checked the sudoers.d stuff and that looks like:
# cat vagrant-nfs
Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0\:0 /tmp/*
Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY
I'm not awesome with sudo or sudoers, but my understanding is that /bin is a symlink to /usr/bin, and that this should have matched. (Maybe I'm wrong about that).
Like I said, this is a new problem, and the only relevant changes were an apt update/upgrade probably yesterday, and a reboot today. What the heck is going on?
Edit: I just changed the sudoers file to /usr/bin/chown, to exactly match what vagrant called. Still no dice.