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
|
||||
|
||||
# Enable passwordless sudo for users under the "sudo" group
|
||||
cp ${ROOTFS}/etc/sudoers{,.orig}
|
||||
sed -i -e \
|
||||
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \
|
||||
${ROOTFS}/etc/sudoers
|
||||
echo "vagrant ALL=NOPASSWD:ALL" > ${ROOTFS}/etc/sudoers.d/vagrant
|
||||
chmod 0440 ${ROOTFS}/etc/sudoers.d/vagrant
|
||||
|
||||
|
||||
##################################################################################
|
||||
|
|
|
@ -81,10 +81,8 @@ 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
|
||||
cp ${ROOTFS}/etc/sudoers{,.orig}
|
||||
sed -i -e \
|
||||
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \
|
||||
${ROOTFS}/etc/sudoers
|
||||
echo "vagrant ALL=NOPASSWD:ALL" > ${ROOTFS}/etc/sudoers.d/vagrant
|
||||
chmod 0440 ${ROOTFS}/etc/sudoers.d/vagrant
|
||||
|
||||
|
||||
##################################################################################
|
||||
|
|
Loading…
Reference in a new issue