summaryrefslogtreecommitdiff
path: root/definitions/wheezy/vagrant.sh
blob: 05605d3436f6a9a1035b622a3140ab28b373a508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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