Only give vagrant NOPASSWD ALL
This commit is contained in:
parent
c2f4cfda4f
commit
ba2569c222
2 changed files with 4 additions and 8 deletions
|
@ -98,10 +98,8 @@ 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
|
||||||
cp ${ROOTFS}/etc/sudoers{,.orig}
|
echo "vagrant ALL=NOPASSWD:ALL" > ${ROOTFS}/etc/sudoers.d/vagrant
|
||||||
sed -i -e \
|
chmod 0440 ${ROOTFS}/etc/sudoers.d/vagrant
|
||||||
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \
|
|
||||||
${ROOTFS}/etc/sudoers
|
|
||||||
|
|
||||||
|
|
||||||
##################################################################################
|
##################################################################################
|
||||||
|
|
|
@ -81,10 +81,8 @@ 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
|
||||||
cp ${ROOTFS}/etc/sudoers{,.orig}
|
echo "vagrant ALL=NOPASSWD:ALL" > ${ROOTFS}/etc/sudoers.d/vagrant
|
||||||
sed -i -e \
|
chmod 0440 ${ROOTFS}/etc/sudoers.d/vagrant
|
||||||
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \
|
|
||||||
${ROOTFS}/etc/sudoers
|
|
||||||
|
|
||||||
|
|
||||||
##################################################################################
|
##################################################################################
|
||||||
|
|
Loading…
Add table
Reference in a new issue