Drunken Coder

Cool SSH Trick

Posted 05/14/2013

I have a generic disposable SSH keypair for working on projects on AWS. I like to not have to remember dumb details (especially when I’m drunk.)


Here is how to only have to type ssh HOST and have it use the right key with all new Ubuntu instances I spin-up. Make a file called ~/.ssh/config that looks like this:

Host *.compute.amazonaws.com
    User ubuntu
    IdentityFile ~/.ssh/deploy.key

Save a key named “deploy” in ~/.ssh/deploy.key and it will automatically use that, and “ubuntu” username.

If you need to generate a pubkey (like for a github project deploy key, etc) Use this command:

ssh-keygen -y -f ~/.ssh/deploy.key


READ THIS NEXT:

Automated Clustered Load Testing with EC2 & node

I made a simple little clustered testing system, using NodeStressSuite. Basically, I want it to launch a bunch of instances, clobber a server, then remove all the machines. This is all automated, so...

David KonsumerWritten by David Konsumer who lives and works in Portland and makes rad stuff. You should follow him on Twitter & Github