Created
September 25, 2013 09:19
-
-
Save thoward/6697128 to your computer and use it in GitHub Desktop.
Create a three-box environment using vagrant-testbed. Generates unique ssh keys for each box and removes default vagrant keys.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# make three boxes | |
BOXES=3 IP_START=60 vagrant up | |
# generate ssh keys | |
if [ ! -f /tmp/testbed1.pub ]; then | |
ssh-keygen -b 2048 -t rsa -f /tmp/testbed1 -P "" -C "testbed1" | |
fi | |
if [ ! -f /tmp/testbed2.pub ]; then | |
ssh-keygen -b 2048 -t rsa -f /tmp/testbed2 -P "" -C "testbed2" | |
fi | |
if [ ! -f /tmp/testbed3.pub ]; then | |
ssh-keygen -b 2048 -t rsa -f /tmp/testbed3 -P "" -C "testbed3" | |
fi | |
# install keys | |
scp -i ~/.vagrant.d/insecure_private_key /tmp/testbed1.pub [email protected]:~/.ssh/authorized_keys | |
scp -i ~/.vagrant.d/insecure_private_key /tmp/testbed2.pub [email protected]:~/.ssh/authorized_keys | |
scp -i ~/.vagrant.d/insecure_private_key /tmp/testbed3.pub [email protected]:~/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment