Add packaging for vagrant box and cleanup step
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user