packer-cn/examples/hcl/linux/etc/scripts/040-sudoers.sh

8 lines
248 B
Bash
Raw Normal View History

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