alt-linux-vagrant-boxes/alt-server-v-10/setup.sh

11 lines
478 B
Bash
Raw Permalink Normal View History

2023-11-18 17:28:18 +03:00
#!/bin/bash -e
# add vagrant's public key - user can ssh without password
2023-11-19 23:47:11 +03:00
mkdir -pm 700 /home/vagrant/.ssh
curl -q -o /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
2023-11-18 17:28:18 +03:00
# give sudo access (grants all permissions to user vagrant)
2023-11-19 23:47:11 +03:00
echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant