github.com/hashicorp/packer@v1.14.3/examples/hcl/linux/etc/scripts/040-sudoers.sh (about)

     1  #!/bin/sh -eux
     2  
     3  sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers;
     4  
     5  # Set up password-less sudo for the vagrant user
     6  echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/99_vagrant;
     7  chmod 440 /etc/sudoers.d/99_vagrant;