#!/bin/bash -xe # Setup that needs to be done before this is run: # # (1) create the instance using the EC2 management console -- you want # to use the squeeze image that doesn't have "beta" in its name # # (2) Login to the new machine using "ssh -i humbug.pem", change the # root password to something random (we'll use SSH keys to get # access), and add our normal keys to /root/.ssh/authorized_keys # Run the script from the directory where it lives, so we can # easily access config files etc. cd "$(dirname "$(readlink -f $0)")" if ! [ -f apache/certs/humbug-self-signed.key ]; then echo "Copy humbug-self-signed.key to $(pwd)/apache/certs, but don't check it into git" exit 1 fi # Configure sshd to disallow password logins cat >>/etc/ssh/sshd_config <>/etc/sudoers fi # Resize the filesystem to fill the EBS volume resize2fs /dev/xvda1 # Add squeeze-backports and install packages cat >>/etc/apt/sources.list <