Complete NOPASSWD for vagrant

Previously, vagrant could not do everything with passwordless sudo.  Eg.
`sudo -u other-user ls` would ask for a sudo password, causing tools
like ansible to hang when trying to execute commands as another user.
This commit is contained in:
Darrell Hamilton 2013-11-15 17:27:25 -08:00 committed by Fabio Rehm
parent ba2569c222
commit 774e8175eb
2 changed files with 2 additions and 2 deletions

View file

@ -98,7 +98,7 @@ chroot ${ROOTFS} apt-get install sudo -y --force-yes
chroot ${ROOTFS} adduser vagrant sudo
# Enable passwordless sudo for users under the "sudo" group
echo "vagrant ALL=NOPASSWD:ALL" > ${ROOTFS}/etc/sudoers.d/vagrant
echo "vagrant ALL=(ALL) NOPASSWD:ALL" > ${ROOTFS}/etc/sudoers.d/vagrant
chmod 0440 ${ROOTFS}/etc/sudoers.d/vagrant

View file

@ -81,7 +81,7 @@ echo $VAGRANT_KEY > ${ROOTFS}/home/vagrant/.ssh/authorized_keys
chroot ${ROOTFS} chown -R vagrant: /home/vagrant/.ssh
# Enable passwordless sudo for users under the "sudo" group
echo "vagrant ALL=NOPASSWD:ALL" > ${ROOTFS}/etc/sudoers.d/vagrant
echo "vagrant ALL=(ALL) NOPASSWD:ALL" > ${ROOTFS}/etc/sudoers.d/vagrant
chmod 0440 ${ROOTFS}/etc/sudoers.d/vagrant