From 64b3ca0b206239b029aec6c8976520d8676318a6 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Mon, 25 Mar 2024 11:24:13 -0400 Subject: [PATCH] config.sh: Add snippet to configure sudo for Vagrant images The vagrant user used in Vagrant images needs the ability to use sudo with no restrictions. This is fine and expected for Vagrant images, as they are only intended to be used for development purposes. --- config.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.sh b/config.sh index 3eea870..e998ac4 100755 --- a/config.sh +++ b/config.sh @@ -147,6 +147,13 @@ EOKEYS chmod 600 ~vagrant/.ssh/authorized_keys chown -R vagrant:vagrant ~vagrant/.ssh/ +cat > /etc/sudoers.d/vagrant << EOSUDOER +## Ensure the vagrant user always can use sudo +Defaults:vagrant !requiretty +vagrant ALL=(ALL) NOPASSWD: ALL +EOSUDOER +chmod 600 /etc/sudoers.d/vagrant + cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf <