From eff8d0e0ca256459a7b1f02113b1456bdc5bdd7f Mon Sep 17 00:00:00 2001 From: kwadronaut Date: Fri, 28 Feb 2014 14:51:08 +0100 Subject: upgraded veewee, easier if it's all under a 'definitions' directory --- definitions/wheezy/vagrant.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 definitions/wheezy/vagrant.sh (limited to 'definitions/wheezy/vagrant.sh') diff --git a/definitions/wheezy/vagrant.sh b/definitions/wheezy/vagrant.sh new file mode 100644 index 0000000..05605d3 --- /dev/null +++ b/definitions/wheezy/vagrant.sh @@ -0,0 +1,26 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -Lo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# setup vagrant low security ssh public key to be able to connect as root +mkdir /root/.ssh +cp /home/vagrant/.ssh/authorized_keys /root/.ssh +chown -R root:root /root/.ssh +chmod 0700 /root/.ssh +chmod 0600 /root/.ssh/authorized_keys + + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + + -- cgit v1.2.3