aboutsummaryrefslogtreecommitdiff
path: root/config.sh
diff options
from:
to:
context:
space:
mode:
authorGravatar Neal Gompa <ngompa@fedoraproject.org> 2024-03-25 11:24:13 -0400
committerGravatar Neal Gompa <ngompa@fedoraproject.org> 2024-03-25 11:24:13 -0400
commit64b3ca0b206239b029aec6c8976520d8676318a6 (patch)
tree1058e7f68ae947572fa6573b44cee1292e17601b /config.sh
parent08243564f393cab9a8ab553c9a7164b5bdf012ce (diff)
downloadkiwi-descriptions-64b3ca0b206239b029aec6c8976520d8676318a6.tar.gz
kiwi-descriptions-64b3ca0b206239b029aec6c8976520d8676318a6.zip
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.
Diffstat (limited to 'config.sh')
-rwxr-xr-xconfig.sh7
1 files changed, 7 insertions, 0 deletions
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 <<EOF
# For now the vagrant insecure key is an rsa key
# https://github.com/hashicorp/vagrant/issues/11783