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:
parent
ba2569c222
commit
774e8175eb
2 changed files with 2 additions and 2 deletions
|
@ -98,7 +98,7 @@ chroot ${ROOTFS} apt-get install sudo -y --force-yes
|
||||||
chroot ${ROOTFS} adduser vagrant sudo
|
chroot ${ROOTFS} adduser vagrant sudo
|
||||||
|
|
||||||
# Enable passwordless sudo for users under the "sudo" group
|
# 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
|
chmod 0440 ${ROOTFS}/etc/sudoers.d/vagrant
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ echo $VAGRANT_KEY > ${ROOTFS}/home/vagrant/.ssh/authorized_keys
|
||||||
chroot ${ROOTFS} chown -R vagrant: /home/vagrant/.ssh
|
chroot ${ROOTFS} chown -R vagrant: /home/vagrant/.ssh
|
||||||
|
|
||||||
# Enable passwordless sudo for users under the "sudo" group
|
# 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
|
chmod 0440 ${ROOTFS}/etc/sudoers.d/vagrant
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue