Allow vagrant user to sudo to all users

This addresses atomic-wg issue 173.

Also vagrant docs https://www.vagrantup.com/docs/boxes/base.html
tell to configure it like this.
This commit is contained in:
Thomas Mueller 2017-02-03 16:47:57 +01:00
parent fb5f48f81a
commit 2cb099d7a3
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ passwd -u root
# Vagrant setup # Vagrant setup
sed -i 's,Defaults\\s*requiretty,Defaults !requiretty,' /etc/sudoers sed -i 's,Defaults\\s*requiretty,Defaults !requiretty,' /etc/sudoers
echo 'vagrant ALL=NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd
sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
mkdir -m 0700 -p ~vagrant/.ssh mkdir -m 0700 -p ~vagrant/.ssh
cat > ~vagrant/.ssh/authorized_keys << EOKEYS cat > ~vagrant/.ssh/authorized_keys << EOKEYS

View File

@ -45,7 +45,7 @@ systemctl mask cloud-init cloud-init-local cloud-config cloud-final
# Vagrant setup # Vagrant setup
sed -i 's,Defaults\\s*requiretty,Defaults !requiretty,' /etc/sudoers sed -i 's,Defaults\\s*requiretty,Defaults !requiretty,' /etc/sudoers
echo 'vagrant ALL=NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd
sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
mkdir -m 0700 -p ~vagrant/.ssh mkdir -m 0700 -p ~vagrant/.ssh
cat > ~vagrant/.ssh/authorized_keys << EOKEYS cat > ~vagrant/.ssh/authorized_keys << EOKEYS