I have a couple VPS’s already but I decided to mess around with the free micro EC2 Amazon provides as part of their AWS service. I already use S3 and some other features so I figured I’d give this a shot. It’s pretty simple to set up out of the gate but there are a couple gotchas. I’ll edit/update this post as I encounter them but here’s the first one.
Connecting to your instance. Setting up your Keypair
During the wizard setup portion of your EC2 setup you’ll create a keypair. There are a couple things you’ll need to do when working on a Mac to get this to work.
- You need to change the read/write permissions.chmod 600 ~/path/to/your/keypair.pem
This will fix any Warning Unprotected Private Key File errors you may get.
Add the keypair identity to your ~/.ssh<
folder. This is done by running the command
Connect using the key pair. Even though you’ve added the keypair to your ~/.ssh
you are still going to need to declare the keypair when you ssh into the box. To ssh into the box the command is
ssh -i ~/.ssh/id_rsa [email protected]mi.amazonaws.com
The -i flag lets ssh know that you’re using an identity file. Also, notice you log in as an ec2-user and not root. Trying to log in as root will cause the VM to bark at you and hang until you break the connection. Well that’s it for now. Next step is to set up the box for Rails. I’ll try and update this blog soon with that howto.