Skip to content

Instantly share code, notes, and snippets.

@dharmab
Last active December 30, 2015 04:53
Show Gist options
  • Select an option

  • Save dharmab/949da58f932e4c35a5f1 to your computer and use it in GitHub Desktop.

Select an option

Save dharmab/949da58f932e4c35a5f1 to your computer and use it in GitHub Desktop.
# Install Vagrant insecure private key
vagrant_insecure_public_key_url='https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub'
vagrant_insecure_private_key_url="https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant"
public_key=~/.ssh/id_rsa.pub
private_key=~/.ssh/id_rsa
sudo -u vagrant -H /usr/bin/bash -s <<EOF
if [ ! -f $private_key ]; then
curl -s ${vagrant_insecure_private_key_url} -o $private_key;
fi;
if [ ! -f $public_key ]; then
curl -s ${vagrant_insecure_public_key_url} -o $public_key;
fi;
chmod 0600 ~/.ssh/id_rsa;
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment