Add packaging for vagrant box and cleanup step

This commit is contained in:
2025-11-01 23:31:43 -04:00
parent 4b49404a0c
commit b7d76be6ce
9 changed files with 108 additions and 23 deletions

View File

@@ -3,9 +3,9 @@ set -eu
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y openssl curl sudo
apt-get install -y qemu-guest-agent nfs-common openssl curl sudo vim
useradd -m -p "$(openssl passwd -1 vagrant)" vagrant
useradd -m -s /bin/bash -p "$(openssl passwd -1 vagrant)" vagrant
echo "vagrant ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/vagrant
chmod 440 /etc/sudoers.d/vagrant
@@ -15,6 +15,7 @@ BASE_GH_URL="https://raw.githubusercontent.com/hashicorp/vagrant/refs/heads"
curl -fsSL "${BASE_GH_URL}/main/keys/vagrant.pub" \
-o /home/vagrant/.ssh/authorized_keys
chmod 600 /home/vagrant/.ssh/authorized_keys
chown vagrant:vagrant /home/vagrant/.ssh/authorized_keys
sed -i 's/PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
passwd -d root