2023-11-18 17:28:18 +03:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2023-11-19 22:26:09 +03:00
|
|
|
a= . install2-init-functions
|
|
|
|
|
2023-11-18 17:28:18 +03:00
|
|
|
# add vagrant's public key - user can ssh without password
|
2023-11-19 22:26:09 +03:00
|
|
|
run_chroot mkdir -pm 700 /home/vagrant/.ssh
|
|
|
|
run_chroot curl -q -o /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub
|
|
|
|
run_chroot chmod 0600 /home/vagrant/.ssh/authorized_keys
|
|
|
|
run_chroot 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 22:26:09 +03:00
|
|
|
run_chroot echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
|
|
|
|
run_chroot chmod 0440 /etc/sudoers.d/vagrant
|